1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

lxc: Avoid possible NULL dereference on *root prior to opendir().

If running on older Linux without mounted cgroups then its possible that
*root would be NULL.
This commit is contained in:
John Ferlan 2013-01-07 12:09:33 -05:00 committed by Eric Blake
parent 2e0e1a91f7
commit 36ac6e37be

View File

@ -1762,6 +1762,12 @@ static int lxcContainerIdentifyCGroups(struct lxcContainerCGroup **mountsret,
VIR_DEBUG("Grabbed '%s'", mntent.mnt_dir);
}
if (!*root) {
VIR_DEBUG("No mounted cgroups found");
ret = 0;
goto cleanup;
}
VIR_DEBUG("Checking for symlinks in %s", *root);
if (!(dh = opendir(*root))) {
virReportSystemError(errno,