Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] [python] Fix for double-free.
@ 2008-10-23 17:22 Paul Pluzhnikov
  2008-10-23 19:16 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Pluzhnikov @ 2008-10-23 17:22 UTC (permalink / raw)
  To: gdb-patches

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);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-23 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-23 17:22 [patch] [python] Fix for double-free Paul Pluzhnikov
2008-10-23 19:16 ` Pedro Alves
2008-10-23 22:51   ` Paul Pluzhnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox