From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25986 invoked by alias); 23 Oct 2008 17:22:39 -0000 Received: (qmail 25974 invoked by uid 22791); 23 Oct 2008 17:22:38 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Oct 2008 17:22:03 +0000 Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id m9NHM1BV029327 for ; Thu, 23 Oct 2008 10:22:01 -0700 Received: from localhost (elbrus.corp.google.com [172.18.116.17]) by wpaz1.hot.corp.google.com with ESMTP id m9NHLxiu028889; Thu, 23 Oct 2008 10:21:59 -0700 Received: by localhost (Postfix, from userid 74925) id D13083A6AFD; Thu, 23 Oct 2008 10:21:58 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [patch] [python] Fix for double-free. Message-Id: <20081023172158.D13083A6AFD@localhost> Date: Thu, 23 Oct 2008 17:22:00 -0000 From: ppluzhnikov@google.com (Paul Pluzhnikov) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00578.txt.bz2 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 * 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);