This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]