From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29871 invoked by alias); 9 Jan 2015 18:15:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34183 Received: (qmail 15731 invoked from network); 9 Jan 2015 18:15:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=U8x73H08pUQ9rBATJ7Nnpg==:117 a=U8x73H08pUQ9rBATJ7Nnpg==:17 a=Hpgzp-inWqAA:10 a=IkcTkHD0fZMA:10 a=AvPape_rAagf39AsKqQA:9 a=QEXdDO2ut3YA:10 Message-id: <54B013C5.6090307@eastlink.ca> Date: Fri, 09 Jan 2015 09:45:41 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-version: 1.0 To: zsh-workers@zsh.org Subject: Re: PATCH: hist: remove wrong NULL terminator References: <1420807419-9270-1-git-send-email-mikachu@gmail.com> In-reply-to: <1420807419-9270-1-git-send-email-mikachu@gmail.com> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit On 01/09/2015 04:43 AM, Mikael Magnusson wrote: > This actually writes a NULL to some arbitrary location in the caller function's stack. Found by Coverity (Issue 1255746). > > The start of the quote() function does char **str = tr; and is called like this, > quote(&sline); > sline in turn is just a char *sline; > The result of str[1] = NULL; is then, as far as I can tell, not anything good. I also can't see any other thing that might have been intended to be NULL-terminated here, so just remove it. Holy Cow. That's just been sitting there for god knows how long?