/* 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.
close (f);
goto stub_end;
}
- if (! CONST_STRNEQ (magic, "go32stub"))
+ if (! startswith (magic, "go32stub"))
{
close (f);
goto stub_end;
/* 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. */