mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-03 17:47:15 +03:00
lxc: avoid NULL dereference upon getmntent failure
* src/lxc_container.c (lxcContainerUnmountOldFS): Don't pass a NULL pointer to qsort.
This commit is contained in:
parent
cff257f584
commit
e4ac19a87a
@ -546,8 +546,9 @@ static int lxcContainerUnmountOldFS(void)
|
|||||||
}
|
}
|
||||||
endmntent(procmnt);
|
endmntent(procmnt);
|
||||||
|
|
||||||
qsort(mounts, nmounts, sizeof(mounts[0]),
|
if (mounts)
|
||||||
lxcContainerChildMountSort);
|
qsort(mounts, nmounts, sizeof(mounts[0]),
|
||||||
|
lxcContainerChildMountSort);
|
||||||
|
|
||||||
for (i = 0 ; i < nmounts ; i++) {
|
for (i = 0 ; i < nmounts ; i++) {
|
||||||
VIR_DEBUG("Umount %s", mounts[i]);
|
VIR_DEBUG("Umount %s", mounts[i]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user