On Sat, Sep 15, 2018 at 06:16:42AM -0600, Todd C. Miller wrote:
> On Sat, 15 Sep 2018 12:42:22 +0200, Martijn van Duren wrote:
> 
> > While here, should we also remove any in favour of strchr? Only
> > difference seems to be the return type (bool vs pointer).
> 
> Note that any(NULL, ch) is safe whereas strchr(NULL, ch) will crash.
> It is hard to say whether or not there are actual calls to any()
> with a NULL string (most use a constant string) but this needs to
> be checked before committing.
> 
>  - todd

>From what I see the questionable any() calls look like
any(short2str(a), b). The function short2str() can return NULL if its
parameter is NULL.
On my system I changed short2str() to do

  if (src == NULL) abort();

and the same for any():

  if (s == NULL) abort();

I didn't hit an abort() so far, but it's too early to have any()
confidence in the change.

Reply via email to