From 3c0ed2996e2f868939b67b8b83785c5d5c114474 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Thu, 23 Oct 2008 22:48:40 +0000 Subject: [PATCH] 2008-10-23 Paul Pluzhnikov * python/python-value (valpy_getitem): Fix heap corruption. --- gdb/ChangeLog | 4 ++++ gdb/python/python-value.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8362188a8e4..361667feee5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2008-10-23 Paul Pluzhnikov + + * python/python-value (valpy_getitem): Fix heap corruption. + 2008-10-23 Aleksandar Ristovski * nto-procfs.c (do_attach): Form proper ptid including pid and tid. diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c index 75ae62599c0..d95727371be 100644 --- a/gdb/python/python-value.c +++ b/gdb/python/python-value.c @@ -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); -- 2.30.2