[PATCH] memcmp() error in gas/dwarf2dbg.c

Andreas Jaeger aj@suse.de
Fri Feb 13 15:58:00 GMT 2004


Nick Clifton <nickc@redhat.com> writes:

> Hi Hannes,
>
>> Like this?
>
>> --- binutils-2.14.90.0.8/gas/dwarf2dbg.c.orig	2004-02-13 12:44:42.306841116 +0100
>> +++ binutils-2.14.90.0.8/gas/dwarf2dbg.c	2004-02-13 12:45:04.418980440 +0100
>> @@ -372,7 +372,7 @@
>>      {
>>        --dir_len;
>>        for (dir = 1; dir < dirs_in_use; ++dir)
>> -	if (memcmp (filename, dirs[dir], dir_len) == 0
>> +	if (strncmp (filename, dirs[dir], dir_len) == 0
>>  	    && dirs[dir][dir_len] == '\0')
>>  	  break;
>>  
>
> Much better - Andreas can you handle applying this patch please ?

Will do - after a sanity build of binutils...

ChangeLog will be:

2004-02-13  Hannes Reinecke  <hare@suse.de>
            Jakub Jelinek  <jakub@redhat.com>

	* dwarf2dbg.c (get_filenum): Do not read beyond allocated memory.

thanks for the review,
Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20040213/2465ff49/attachment.sig>


More information about the Binutils mailing list