AArch64: Add gdbserver MTE support
[deliverable/binutils-gdb.git] / bfd / coff-stgo32.c
index b5e893d771dee2db369b2bf3d7b86d7599e3a16e..8f75eecf4ee15546829147c1e472281f404518bb 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub).
-   Copyright (C) 1997-2020 Free Software Foundation, Inc.
+   Copyright (C) 1997-2021 Free Software Foundation, Inc.
    Written by Robert Hoehne.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -176,7 +176,7 @@ go32exe_create_stub (bfd *abfd)
          close (f);
          goto stub_end;
        }
-      if (! CONST_STRNEQ (magic, "go32stub"))
+      if (! startswith (magic, "go32stub"))
        {
          close (f);
          goto stub_end;
@@ -304,7 +304,9 @@ go32exe_check_format (bfd *abfd)
 
   /* Confirm that this is a go32stub.  */
   header_end = H_GET_16 (abfd, filehdr_dos.e_cparhdr) * 16UL;
-  if (! CONST_STRNEQ (go32exe_temp_stub + header_end, "go32stub"))
+  if (go32exe_temp_stub_size < header_end
+      || go32exe_temp_stub_size - header_end < sizeof "go32stub" - 1
+      || !startswith (go32exe_temp_stub + header_end, "go32stub"))
     goto fail_format;
 
   /* Set origin to where the COFF header starts and seek there.  */
This page took 0.023925 seconds and 4 git commands to generate.