From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28210 invoked by alias); 12 May 2003 08:56:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 28141 invoked by uid 71); 12 May 2003 08:56:03 -0000 Date: Mon, 12 May 2003 08:56:00 -0000 Message-ID: <20030512085603.28135.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Richard Frith-Macdonald Subject: Re: libobjc/9751: malloc of strlen, not strlen+1 Reply-To: Richard Frith-Macdonald X-SW-Source: 2003-05/txt/msg01127.txt.bz2 List-Id: The following reply was made to PR libobjc/9751; it has been noted by GNATS. From: Richard Frith-Macdonald To: gcc-prs@gcc.gnu.org, john.carter@tait.co.nz, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: libobjc/9751: malloc of strlen, not strlen+1 Date: Mon, 12 May 2003 09:51:54 +0100 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9751 I was just looking at this ... and I don't think this is a bug. If I understand the code correctly, it is removing a single byte (the garbage collecting invisibility marker) from the type string. So the length of the new string is one byte less than that of the original. So allocating strlen(ivar->ivar_type) bytes is correct. It might perhaps be worth adding a comment to thiks effect in the source though.