mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-29 20:11:16 +00:00
interface: udev backend coverity NULL deref
This fixes a potential NULL deref identified by John Ferlan <jferlan@redhat.com> if scandir() didn't return an expected value.
This commit is contained in:
parent
464c92c051
commit
01207bb703
@ -779,6 +779,13 @@ udevIfaceGetIfaceDefBond(struct udev *udev,
|
|||||||
* so we use the part after the _
|
* so we use the part after the _
|
||||||
*/
|
*/
|
||||||
tmp_str = strchr(slave_list[i]->d_name, '_');
|
tmp_str = strchr(slave_list[i]->d_name, '_');
|
||||||
|
if (!tmp_str || strlen(tmp_str) < 2) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Invalid enslaved interface name '%s' seen for "
|
||||||
|
"bond '%s'"), slave_list[i]->d_name, name);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
/* go past the _ */
|
||||||
tmp_str++;
|
tmp_str++;
|
||||||
|
|
||||||
ifacedef->data.bond.itf[i] =
|
ifacedef->data.bond.itf[i] =
|
||||||
|
Loading…
Reference in New Issue
Block a user