[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1/9] libxl: fix libxl__abs_path
If s is NULL, just return NULL to avoid libxl__strdup dereferencing NULL pointer. Signed-off-by: Wei Liu <wei.liu2@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); } -- 1.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |