This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/6.7] Fix a memory access error for qOffsets
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Fri, 5 Oct 2007 17:38:27 -0400
- Subject: [commit/6.7] Fix a memory access error for qOffsets
One of our customers has a setup in which GDB loads an unlinked object
file and connects to a remote target, which replies to qOffsets with
text and data offsets. This does not work excellently, but it does
work for straightforward cases... but it caught a thinko in my recent
qOffsets changes.
I've committed the attached to HEAD and 6.7 to prevent us from
following a NULL pointer.
--
Daniel Jacobowitz
CodeSourcery
2007-10-05 Daniel Jacobowitz <dan@codesourcery.com>
* remote.c (get_offsets): Only call free_symfile_segment_data if
data was allocated.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.269
diff -u -p -r1.269 remote.c
--- remote.c 1 Oct 2007 00:17:58 -0000 1.269
+++ remote.c 2 Oct 2007 15:32:02 -0000
@@ -2134,7 +2134,8 @@ get_offsets (void)
do_sections = 0;
}
- free_symfile_segment_data (data);
+ if (data)
+ free_symfile_segment_data (data);
if (do_sections)
{