From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 617 invoked by alias); 6 Aug 2007 22:30:49 -0000 Received: (qmail 475 invoked by uid 22791); 6 Aug 2007 22:30:48 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 06 Aug 2007 22:30:47 +0000 Received: (qmail 5039 invoked from network); 6 Aug 2007 22:30:45 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Aug 2007 22:30:45 -0000 To: msnyder@sonic.net Cc: gdb-patches@sourceware.org Subject: Re: [patch] target_read_string, potential memory leak. References: <13153.12.7.175.2.1186284546.squirrel@webmail.sonic.net> From: Jim Blandy Date: Mon, 06 Aug 2007 22:30:00 -0000 In-Reply-To: <13153.12.7.175.2.1186284546.squirrel@webmail.sonic.net> (msnyder@sonic.net's message of "Sat, 4 Aug 2007 20:29:06 -0700 (PDT)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2007-08/txt/msg00126.txt.bz2 msnyder@sonic.net writes: > OK -- it would be pretty stupid to call target_read_string without > passing it a buffer, but if we're going to check it for null... I don't think the contract for target_read_string permits STRING to be null. I think either the test should go, or we should add a gdb_assert (string).