On Wed, Dec 05, 2018 at 12:05:23PM +0000, Paul Durrant wrote:
> > > +    value = xs_read(xsh, XBT_NULL, path, NULL);
> > 
> > The xenstore.h isn't clear about failure of this function, it is
> > supposed to return a malloced value. Do we actually need to check if value
> > is NULL?
> 
> The comment above xs_read() in xs.c is:
> 
> /* Get the value of a single file, nul terminated.                          
>  * Returns a malloced value: call free() on it after use.                   
>  * len indicates length in bytes, not including the nul.                    
>  */
> 
> and I think we should check it for NULL before passing it to vsscanf().

I've sent a patch against xenstore.h to document that xs_read, and some
other functions, can return NULL.
<20181205162603.25788-1-anthony.per...@citrix.com>

-- 
Anthony PERARD

Reply via email to