From ae79d2f9ec344703f379a557b873efc9bf70cd1e Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 20 May 2009 12:05:45 +0000 Subject: Update HiiDataBase to fix the SCT hang issues by the invalid device path. Update the driver config access protocol extractconfig and routeconfig interface to check the input parameters. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8349 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c | 17 ++++++++++++++++- .../Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c | 15 ++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'MdeModulePkg/Universal/Network') diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c index 8982a3b99f..59840f7f06 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c @@ -359,9 +359,10 @@ IScsiFormExtractConfig ( ISCSI_FORM_CALLBACK_INFO *Private; EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; - if (Request == NULL) { + if (Request == NULL || Progress == NULL || Results == NULL) { return EFI_INVALID_PARAMETER; } + *Progress = Request; if (!mIScsiDeviceListUpdated) { // @@ -444,6 +445,20 @@ IScsiFormRouteConfig ( OUT EFI_STRING *Progress ) { + if (Configuration == NULL || Progress == NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // Check routing data in . + // Note: if only one Storage is used, then this checking could be skipped. + // + if (!HiiIsConfigHdrMatch (Configuration, &mVendorGuid, mVendorStorageName)) { + *Progress = Configuration; + return EFI_NOT_FOUND; + } + + *Progress = Configuration + StrLen (Configuration); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c index 3bcad8352c..b7de203881 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c @@ -554,6 +554,9 @@ Ip4FormExtractConfig ( OUT EFI_STRING *Results ) { + if (Request == NULL || Progress == NULL || Results == NULL) { + return EFI_INVALID_PARAMETER; + } *Progress = Request; return EFI_NOT_FOUND; } @@ -599,7 +602,17 @@ Ip4FormRouteConfig ( OUT EFI_STRING *Progress ) { - return EFI_NOT_FOUND; + if (Configuration == NULL || Progress == NULL) { + return EFI_INVALID_PARAMETER; + } + + *Progress = Configuration; + if (!HiiIsConfigHdrMatch (Configuration, &gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) { + return EFI_NOT_FOUND; + } + + *Progress = Configuration + StrLen (Configuration); + return EFI_SUCCESS; } /** -- cgit v1.2.3