Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: ppluzhnikov@google.com (Paul Pluzhnikov)
To: gdb-patches@sourceware.org
Subject: [patch] [python] Fix for double-free.
Date: Thu, 23 Oct 2008 17:22:00 -0000	[thread overview]
Message-ID: <20081023172158.D13083A6AFD@localhost> (raw)

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


             reply	other threads:[~2008-10-23 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 17:22 Paul Pluzhnikov [this message]
2008-10-23 19:16 ` Pedro Alves
2008-10-23 22:51   ` Paul Pluzhnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081023172158.D13083A6AFD@localhost \
    --to=ppluzhnikov@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox