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

Hannes Reinecke hare@suse.de
Fri Feb 13 11:12:00 GMT 2004


Hi,

there is a possible memory overflow in gas/dwarf3dbg.c: get_filenum():375

	if (memcmp (filename, dirs[dir], dir_len) == 0
	    && dirs[dir][dir_len] == '\0')

dir_len is set to strlen(filename), which will overflow onto unallocated 
memory if strlen(filename) > strlen(dirs[dir]).
The attached patch fixes this.

Please keep me cc'ed as I'm not on this list.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gas-memcmp.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20040213/873b2cf4/attachment.ksh>


More information about the Binutils mailing list