]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
Return empty string when END device path is passed in to align the original behavior...
[mirror_edk2.git] / MdeModulePkg / Universal / DevicePathDxe / DevicePathToText.c
index d169c4d0d5013a5bad7ef0f4840b0765c599f6e9..d7cff207fe60181dd0ff12b5a04d20227c9c015d 100644 (file)
@@ -1875,6 +1875,7 @@ ConvertDeviceNodeToText (
   //\r
   DumpNode (&Str, (VOID *) DeviceNode, DisplayOnly, AllowShortcuts);\r
 \r
+  ASSERT (Str.Str != NULL);\r
   return Str.Str;\r
 }\r
 \r
@@ -1959,5 +1960,9 @@ ConvertDevicePathToText (
     DevPathNode = NextDevicePathNode (DevPathNode);\r
   }\r
 \r
-  return Str.Str;\r
+  if (Str.Str == NULL) {\r
+    return AllocateZeroPool (sizeof (CHAR16));\r
+  } else {\r
+    return Str.Str;\r
+  }\r
 }\r