if (hdr_id == 0)
{
unsigned int initial_insn_length;
+ char *null_byte;
/* CIE */
this_inf->cie = 1;
REQUIRE (cie->version == 1
|| cie->version == 3
|| cie->version == 4);
- REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation));
+ null_byte = memchr ((char *) buf, 0, end - buf);
+ REQUIRE (null_byte != NULL);
+ REQUIRE ((size_t) (null_byte - (char *) buf)
+ < sizeof (cie->augmentation));
strcpy (cie->augmentation, (char *) buf);
- buf = (bfd_byte *) strchr ((char *) buf, '\0') + 1;
+ buf = (bfd_byte *) null_byte + 1;
this_inf->u.cie.aug_str_len = buf - start - 1;
ENSURE_NO_RELOCS (buf);
if (buf[0] == 'e' && buf[1] == 'h')