gdb/gdb-bz653644-gdbindex-doubl...

31 lines
1014 B
Diff

https://bugzilla.redhat.com/show_bug.cgi?id=653644
[commit] Fix .gdb_index memory corruption
http://sourceware.org/ml/gdb-patches/2010-11/msg00216.html
http://sourceware.org/ml/gdb-cvs/2010-11/msg00080.html
### src/gdb/ChangeLog 2010/11/16 17:38:34 1.12313
### src/gdb/ChangeLog 2010/11/16 22:04:51 1.12314
## -1,3 +1,8 @@
+2010-11-16 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * dwarf2read.c (dw2_forget_cached_source_info): Clear the FULL_NAMES
+ elements after xfree.
+
2010-11-16 Tom Tromey <tromey@redhat.com>
* gdb-add-index.sh: Really remove.
--- gdb-7.2/gdb/dwarf2read.c.orig 2010-11-18 05:28:59.000000000 +0100
+++ gdb-7.2/gdb/dwarf2read.c 2010-11-18 05:30:17.000000000 +0100
@@ -2084,7 +2084,10 @@ dw2_forget_cached_source_info (struct ob
int j;
for (j = 0; j < cu->v.quick->lines->num_file_names; ++j)
- xfree ((void *) cu->v.quick->full_names[j]);
+ {
+ xfree ((void *) cu->v.quick->full_names[j]);
+ cu->v.quick->full_names[j] = NULL;
+ }
}
}
}