From: Laine Stump Date: Tue, 29 Jun 2010 03:50:15 +0000 (-0400) Subject: Avoid calling virStorageFileIsSharedFS with NULL X-Git-Tag: v0.8.2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11a706025054fa29837dcb0e6308fd947b275558;p=thirdparty%2Flibvirt.git Avoid calling virStorageFileIsSharedFS with NULL This code was just recently added (by me) and didn't account for the fact that stdin_path is sometimes NULL. If it's NULL, and SetSecurityAllLabel fails, a segfault would result. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2a277a5057..e8c5c35651 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3429,7 +3429,7 @@ static int qemudStartVMDaemon(virConnectPtr conn, if (driver->securityDriver && driver->securityDriver->domainSetSecurityAllLabel && driver->securityDriver->domainSetSecurityAllLabel(vm, stdin_path) < 0) { - if (virStorageFileIsSharedFS(stdin_path) != 1) + if (stdin_path && virStorageFileIsSharedFS(stdin_path) != 1) goto cleanup; }