]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Avoid calling virStorageFileIsSharedFS with NULL
authorLaine Stump <laine@redhat.com>
Tue, 29 Jun 2010 03:50:15 +0000 (23:50 -0400)
committerLaine Stump <laine@redhat.com>
Tue, 29 Jun 2010 03:52:04 +0000 (23:52 -0400)
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.

src/qemu/qemu_driver.c

index 2a277a505776db7405375ec43e6fd826735b13db..e8c5c356519ae7ed801dae91f4b843b8eac2a1ed 100644 (file)
@@ -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;
     }