2008-10-23 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 23 Oct 2008 22:48:40 +0000 (22:48 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 23 Oct 2008 22:48:40 +0000 (22:48 +0000)
* python/python-value (valpy_getitem): Fix heap corruption.

gdb/ChangeLog
gdb/python/python-value.c

index 8362188a8e4debd6e493e7e0c3230fff9c464f2a..361667feee5efadab9257596cf2d0e5a9a588eaa 100644 (file)
@@ -1,3 +1,7 @@
+2008-10-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * python/python-value (valpy_getitem): Fix heap corruption.
+       
 2008-10-23  Aleksandar Ristovski  <aristovski@qnx.com>
 
        * nto-procfs.c (do_attach): Form proper ptid including pid and tid.
index 75ae62599c0e7462a37e381d4d16cfec17af13f2..d95727371be731cae59a9d24bbde783458d5cde0 100644 (file)
@@ -161,7 +161,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);