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

Re: [PATCH] mkenvstr: avoid crash in case NULL is given as value



On Wednesday 20 May 2015 19:35:13 Kamil Dudka wrote:
> On Wednesday 20 May 2015 10:23:00 Bart Schaefer wrote:
> > On May 20,  4:43pm, Kamil Dudka wrote:
> > }
> > } Good catch!  Then your patch certainly looks as a better choice to me.
> > 
> > It belatedly occurs to me that adding
> > 
> >     if (!value)
> > 	
> > 	value = "";
> > 
> > would have been a sufficient change.  Oh, well.
> 
> I am quite new to zsh code but this drives me to a question: Are the strings
> allocated in mkenvstr() freed anywhere?

Oops, it is a misleading question anyway.  It would return an allocated string 
in both cases.  Sorry for the noise.

> Kamil



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