message: Improved dynamic length for header checking
diff: @@ -27,6 +27,7 @@ pub struct NativeEngine {
  impl NativeEngine {
  // Mach-O header in Mac
  + #[allow(dead_code)]
  const MAGIC_HEADER_MH_CIGAM_64: &'static [u8] = &[207, 250, 237, 254];
  // ELF Magic header for Linux (32 bit)
  @@ -115,13 +116,13 @@ impl NativeEngine {
  pub fn is_deserializable(bytes: &[u8]) -> bool {
  cfg_if::cfg_if! {
  if #[cfg(all(target_pointer_width = "64", target_os="macos"))] {
  - return &bytes[..4] == Self::MAGIC_HEADER_MH_CIGAM_64;
  + return &bytes[..Self::MAGIC_HEADER_MH_CIGAM_64.len()] == Self::MAGIC_HEADER_MH_CIGAM_64;
  }
  else if #[cfg(all(target_pointer_width = "64", target_os="linux"))] {
  - return &bytes[..5] == Self::MAGIC_HEADER_ELF_64;
  + return &bytes[..Self::MAGIC_HEADER_ELF_64.len()] == Self::MAGIC_HEADER_ELF_64;
  }
  else if #[cfg(all(target_pointer_width = "32", target_os="linux"))] {
  - return &bytes[..5] == Self::MAGIC_HEADER_ELF_32;
  + return &bytes[..Self::MAGIC_HEADER_ELF_32.len()] == Self::MAGIC_HEADER_ELF_32;
  }
  else {
  false
  