PR27844, Unstable symbol name in objdump outputs

Special care for fuzzers.

	PR 27844
	* pdp11.c (aout_get_external_symbols): Clear first four bytes of
	strings array, not just the first byte.
	* aoutx.h (aout_get_external_symbols): Likewise.
This commit is contained in:
Alan Modra 2021-05-11 21:30:14 +09:30
parent a680affc63
commit 8ca5537ba5
3 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2021-05-11 Alan Modra <amodra@gmail.com>
PR 27844
* pdp11.c (aout_get_external_symbols): Clear first four bytes of
strings array, not just the first byte.
* aoutx.h (aout_get_external_symbols): Likewise.
2021-05-10 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/27839

View File

@ -1364,7 +1364,7 @@ aout_get_external_symbols (bfd *abfd)
}
}
/* Ensure that a zero index yields an empty string. */
strings[0] = '\0';
memset (strings, 0, BYTES_IN_WORD);
/* Ensure that the string buffer is NUL terminated. */
strings[stringsize] = 0;

View File

@ -1344,7 +1344,7 @@ aout_get_external_symbols (bfd *abfd)
}
}
/* Ensure that a zero index yields an empty string. */
strings[0] = '\0';
memset (strings, 0, BYTES_IN_LONG);
/* Ensure that the string buffer is NUL terminated. */
strings[stringsize] = 0;