Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: hist: remove wrong NULL terminator
- X-seq: zsh-workers 34186
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Subject: Re: PATCH: hist: remove wrong NULL terminator
- Date: Fri, 9 Jan 2015 20:38:31 +0100
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qHy6/ynWErg661UtxQ4RMqTpT7LKI7gYzEH4IA/yDy4=; b=QW+PA9/0ENyY+j8iZelZPcm3ic44fdNdo5ueKkRq9uCV5uwEpFRUEQ2UFwgcZG4nEX emIKZAls4Cl7OjufaHOXxmTY6xnNoo0fp3YH1qrEfG6Ms2XtI1rdDpQq88Pdj/zPj39P gGBVbkzynGMhuC5Qx6Xwy/VMB8bUyCgvAPMHzEmD1OF2r7tsARr746agTHaPKueqqFXX cJEIpst6usCf6JPmD88Y4/szwDtUfOfTpEEYiPBeiPTs3nubn48Jc4aDDSjuRme9MAF2 pHntzDmEd9F8jqFeplgo93JG1sdgFfdRRgS/VVsyJsZ8V/W84QvJ4aeLyC+gCiSwBRNW 318g==
- In-reply-to: <54B013C5.6090307@eastlink.ca>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1420807419-9270-1-git-send-email-mikachu@gmail.com> <54B013C5.6090307@eastlink.ca>
On Fri, Jan 9, 2015 at 6:45 PM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> 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?
Yes, but it's actually pretty harmless, most other variables on the
stack in that function are never used if we enter this codepath.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author