From: Michal Privoznik Date: Mon, 15 Jul 2013 13:50:29 +0000 (+0200) Subject: virSecurityManagerGenLabel: Skip seclabels without model X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ba44dd2453d486e9eb8c6204f8d7c31d07007d8f;p=libvirt.git virSecurityManagerGenLabel: Skip seclabels without model While generating seclabels, we check the seclabel stack if required driver is in the stack. If not, an error is returned. However, it is possible for a seclabel to not have any model set (happens with LXC domains that have just ). If that's the case, we should just skip the iteration instead of calling STREQ(NULL, ...) and SIGSEGV-ing subsequently. --- diff --git a/src/security/security_manager.c b/src/security/security_manager.c index 6946637dd2..411a9097cd 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -436,6 +436,9 @@ int virSecurityManagerGenLabel(virSecurityManagerPtr mgr, virObjectLock(mgr); for (i = 0; i < vm->nseclabels; i++) { + if (!vm->seclabels[i]->model) + continue; + for (j = 0; sec_managers[j]; j++) if (STREQ(vm->seclabels[i]->model, sec_managers[j]->drv->name)) break;