mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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 <seclabel type='none'>). If that's the case, we should just skip the iteration instead of calling STREQ(NULL, ...) and SIGSEGV-ing subsequently.
This commit is contained in:
parent
37d96498c6
commit
ba44dd2453
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user