]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add some ASSERT()s.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Jan 2009 01:55:14 +0000 (01:55 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Jan 2009 01:55:14 +0000 (01:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7299 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c

index e0f1fcea489c877c73dc39408b1a136573f25f9e..f7e7cdfcfb612cb3daa22a0fd0345940f17e7abe 100644 (file)
@@ -2763,6 +2763,7 @@ ConvertTextToDeviceNode (
   ParamStr      = NULL;\r
   DumpNode      = NULL;\r
   DeviceNodeStr = StrDuplicate (TextDeviceNode);\r
   ParamStr      = NULL;\r
   DumpNode      = NULL;\r
   DeviceNodeStr = StrDuplicate (TextDeviceNode);\r
+  ASSERT (DeviceNodeStr != NULL);\r
 \r
   for (Index = 0; DevPathFromTextTable[Index].Function; Index++) {\r
     ParamStr = GetParamByNodeName (DeviceNodeStr, DevPathFromTextTable[Index].DevicePathNodeText);\r
 \r
   for (Index = 0; DevPathFromTextTable[Index].Function; Index++) {\r
     ParamStr = GetParamByNodeName (DeviceNodeStr, DevPathFromTextTable[Index].DevicePathNodeText);\r
@@ -2822,6 +2823,7 @@ ConvertTextToDevicePath (
   }\r
 \r
   DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
   }\r
 \r
   DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
+  ASSERT (DevicePath != NULL);\r
   SetDevicePathEndNode (DevicePath);\r
 \r
   ParamStr            = NULL;\r
   SetDevicePathEndNode (DevicePath);\r
 \r
   ParamStr            = NULL;\r
@@ -2857,6 +2859,7 @@ ConvertTextToDevicePath (
 \r
     if (IsInstanceEnd != 0) {\r
       DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
 \r
     if (IsInstanceEnd != 0) {\r
       DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
+      ASSERT (DeviceNode != NULL);\r
       SET_DEVICE_PATH_INSTANCE_END_NODE (DeviceNode);\r
 \r
       NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode);\r
       SET_DEVICE_PATH_INSTANCE_END_NODE (DeviceNode);\r
 \r
       NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode);\r
index 2e4a976adc397aa93a05dd55bb965b7d92306383..d45c267ffbbcfe5c9387c0444bc5820e66032d85 100644 (file)
@@ -708,6 +708,7 @@ DevPathToTextUsbWWID (
     // In case no NULL terminator in SerialNumber, create a new one with NULL terminator\r
     //\r
     NewStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), SerialNumberStr);\r
     // In case no NULL terminator in SerialNumber, create a new one with NULL terminator\r
     //\r
     NewStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), SerialNumberStr);\r
+    ASSERT (NewStr != NULL);\r
     NewStr [Length] = 0;\r
     SerialNumberStr = NewStr;\r
   }\r
     NewStr [Length] = 0;\r
     SerialNumberStr = NewStr;\r
   }\r