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

Re: [Xen-devel] [PATCH 1/9] libxl: fix libxl__abs_path



On Fri, 2015-07-10 at 19:00 +0100, Wei Liu wrote:

I rather dislike subjects of the form "fix $function", since it gives
very little clue to someone reading the shortlog what is going on.

In this case I think "libxl: make libxl__abs_path correctly handle a
NULL argument" would be an accurate description.

> If s is NULL, just return NULL to avoid libxl__strdup dereferencing NULL
> pointer.
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>

For the change itself:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  tools/libxl/libxl_internal.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
> index 42d548e..6402c1b 100644
> --- a/tools/libxl/libxl_internal.c
> +++ b/tools/libxl/libxl_internal.c
> @@ -233,8 +233,8 @@ void libxl__log(libxl_ctx *ctx, xentoollog_level 
> msglevel, int errnoval,
>  
>  char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path)
>  {
> -    if (!s || s[0] == '/')
> -        return libxl__strdup(gc, s);
> +    if (!s) return NULL;
> +    if (s[0] == '/') return libxl__strdup(gc, s);
>      return libxl__sprintf(gc, "%s/%s", path, s);
>  }
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.