Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: hist: remove wrong NULL terminator



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?



Messages sorted by: Reverse Date, Date, Thread, Author