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]

[patch] [python] Fix for double-free.


Greetings,

I made the change below on archer-tromey-python.

Unfortunately, I can't seem to be able to construct a test case
which exposes this bug.

OK to commit without a test case?

Thanks,
--
Paul Pluzhnikov

2008-10-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
    
    * python/python-value (valpy_getitem): Fix heap corruption.
    
diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
index 93af465..5064ccf 100644
--- a/gdb/python/python-value.c
+++ b/gdb/python/python-value.c
@@ -209,7 +209,8 @@ valpy_getitem (PyObject *self, PyObject *key)
 
   TRY_CATCH (except, RETURN_MASK_ALL)
     {
-      res_val = value_struct_elt (&self_value->value, NULL, field, 0, NULL);
+      struct value *tmp = self_value->value;
+      res_val = value_struct_elt (&tmp, NULL, field, 0, NULL);
     }
   GDB_PY_HANDLE_EXCEPTION (except);
 


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