提交 dc8dd7f8 编写于 作者: J Jim Meyering

esxVMX_GatherSCSIControllers: avoid NULL dereference

* src/esx/esx_vmx.c (esxVMX_GatherSCSIControllers): Do not dereference
a NULL disk->driverName.  We already detect this condition in another
case.  Check for it here, too.
上级 29045d88
...@@ -570,11 +570,12 @@ esxVMX_GatherSCSIControllers(virDomainDefPtr def, char *virtualDev[4], ...@@ -570,11 +570,12 @@ esxVMX_GatherSCSIControllers(virDomainDefPtr def, char *virtualDev[4],
if (virtualDev[controller] == NULL) { if (virtualDev[controller] == NULL) {
virtualDev[controller] = disk->driverName; virtualDev[controller] = disk->driverName;
} else if (STRCASENEQ(virtualDev[controller], disk->driverName)) { } else if (disk->driverName == NULL ||
STRCASENEQ(virtualDev[controller], disk->driverName)) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Inconsistent driver usage ('%s' is not '%s') on SCSI " _("Inconsistent driver usage ('%s' is not '%s') on SCSI "
"controller index %d"), virtualDev[controller], "controller index %d"), virtualDev[controller],
disk->driverName, controller); disk->driverName ? disk->driverName : "?", controller);
return -1; return -1;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册