View | Details | Raw Unified | Return to bug 23056
Collapse All | Expand All

(-)a/bfd/aoutx.h (-3 / +4 lines)
Lines 1343-1349 aout_get_external_symbols (bfd *abfd) Link Here
1343
#ifdef USE_MMAP
1343
#ifdef USE_MMAP
1344
      if (stringsize >= BYTES_IN_WORD)
1344
      if (stringsize >= BYTES_IN_WORD)
1345
	{
1345
	{
1346
	  if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
1346
	  if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize + 1,
1347
				     &obj_aout_string_window (abfd), TRUE))
1347
				     &obj_aout_string_window (abfd), TRUE))
1348
	    return FALSE;
1348
	    return FALSE;
1349
	  strings = (char *) obj_aout_string_window (abfd).data;
1349
	  strings = (char *) obj_aout_string_window (abfd).data;
Lines 1351-1357 aout_get_external_symbols (bfd *abfd) Link Here
1351
      else
1351
      else
1352
#endif
1352
#endif
1353
	{
1353
	{
1354
	  strings = (char *) bfd_malloc (stringsize);
1354
	  strings = (char *) bfd_malloc (stringsize + 1);
1355
	  if (strings == NULL)
1355
	  if (strings == NULL)
1356
	    return FALSE;
1356
	    return FALSE;
1357
1357
Lines 1370-1376 aout_get_external_symbols (bfd *abfd) Link Here
1370
      /* Ensure that a zero index yields an empty string.  */
1370
      /* Ensure that a zero index yields an empty string.  */
1371
      strings[0] = '\0';
1371
      strings[0] = '\0';
1372
1372
1373
      strings[stringsize - 1] = 0;
1373
      /* Ensure that the string buffer is NUL terminated.  */
1374
      strings[stringsize] = 0;
1374
1375
1375
      obj_aout_external_strings (abfd) = strings;
1376
      obj_aout_external_strings (abfd) = strings;
1376
      obj_aout_external_string_size (abfd) = stringsize;
1377
      obj_aout_external_string_size (abfd) = stringsize;

Return to bug 23056