This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix find_separate_debug_file buffer overrun [Re: gdb crash during read of separate debuginfo]
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Richard Guenther <rguenther at suse dot de>
- Date: Mon, 03 Aug 2009 10:46:34 -0600
- Subject: Re: [patch] Fix find_separate_debug_file buffer overrun [Re: gdb crash during read of separate debuginfo]
- References: <alpine.LNX.2.00.0908021137300.16347@zhemvz.fhfr.qr> <20090802211036.GA28064@host0.dyn.jankratochvil.net>
- Reply-to: tromey at redhat dot com
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Richard> We experienced crashes when running gdb inside out installation
Richard> system which has /usr symlinked to some location beyond /mnt.
Richard> The issue is that the code doesn't deal with the case that
Richard> the result of lrealpath is longer than its argument.
Jan> thanks, posting updated patch for FSF GDB as it is not a Fedora regression.
Jan> This attached patch has not been reviewed by Richard Guenther.
Jan> 2009-08-02 Richard Guenther <rguenther@suse.de>
Jan> Jan Kratochvil <jan.kratochvil@redhat.com>
Jan> Fix memory corruption on reread of file through a symbolic link.
Jan> * symfile.c (find_separate_debug_file): Initialize CANON_NAME earlier.
Jan> Allocate DEBUGFILE with length based on CANON_NAME. Free CANON_NAME on
Jan> all the return paths.
This looks good to me.
Ok.
Jan> I do not push much to get the testcase accepted.
Is there something in particular you think is wrong with it? It looks
ok to me, but your comment makes me wonder what subtlety I missed.
Tom