bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hashlib.c add NULL check for "string" parameter


From: Ángel González
Subject: Re: hashlib.c add NULL check for "string" parameter
Date: Tue, 30 Sep 2014 15:19:40 +0200

Notes Jonny wrote:
> On Mon, Sep 29, 2014 at 2:04 PM, Chet Ramey <address@hidden> wrote:
> > On 9/29/14, 8:22 AM, Notes Jonny wrote:
> >> Hello
> >> I noticed hash_search() did not check if "string" parameter was
> >> non-NULL. Please find attached a patch for this.
> >
> > It's the caller's responsibility to ensure that the string passed to
> > hash_search is non-NULL.
> 
> What's your rationale for that?


He defines the function interface as not allowing a NULL pointer. It has
to be checked by someone, sure, but both checked by caller and checked
by callee are valid approaches.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]