: xl, fix segfault when detaching non-existant disk
PATCH 1/1 : xl, fix segfault when detaching non-existant disk
tools/libxl/libxl_utils.c +2 -0
@@ -451,6 +451,8 @@ int libxl_devid_to_device_disk(struct li } val =libxl_xs_read (ctx,XBT_NULL ,libxl_sprintf (ctx,"%s/backend-id" , diskpath)); +if (!val) +return ERROR_FAIL ; disk->backend_domid =strtoul (val,NULL ,10 ); disk->domid = domid; be_path =libxl_xs_read (ctx,XBT_NULL ,libxl_sprintf (ctx,"%s/backend" , diskpath));
Gianni Tedesco (3P) writes ("[PATCH]: xl, fix segfault when detaching non-existant disk"):
tools/libxl/libxl_utils.c int libxl_devid_to_device_disk(struct li · line 455
Quoted 3 lines
val = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/backend-id", diskpath));tools/libxl/libxl_utils.c +2
-0+if (!val) +return ERROR_FAIL ;
This is fine as far as it goes, and I'll apply it, but would you like to do the same for all the other unchecked libxl_xs_read calls ? :-)
Ian.
Quoted 7 lines · Ian Jackson
Gianni Tedesco (3P) writes ("[PATCH]: xl, fix segfault when detaching non-existant disk"):
tools/libxl/libxl_utils.c int libxl_devid_to_device_disk(struct li · line 455
Quoted 3 lines
val = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/backend-id", diskpath));tools/libxl/libxl_utils.c +2
-0+if (!val) +return ERROR_FAIL ;This is fine as far as it goes, and I'll apply it, but would you like to do the same for all the other unchecked
libxl_xs_readcalls ? :-)
It's a gigantic piece of work, along with sorting out various memory leaks. It is on my TODO list :)
Gianni