Skip to contentSkip to conversation

xl: Fix segment fault of 'xl list'

PATCH Yu Zhiguo 1 participant 1 message Apr 26, 2010

lore
Share & tools
lore

Yu Zhiguo

author
#0 lore raw

If libxl_list_domain() returns NULL, segment fault occurs now.

tools/libxl/xl.c +1 -1
diff -r c87ec146229a -r 5727e3c71513 tools/libxl/xl.c
@@ -1521,7 +1521,7 @@
 
     info = libxl_list_domain(&ctx, &nb_domain);
 
-    if (info < 0) {
+    if (!info) {
         fprintf(stderr, "libxl_domain_infolist failed.\n");
         exit(1);
     }