summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 02:56:38 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 02:56:38 +0000
commit9d4af8fce232b371165eaf4f2c2275886c21ff2b (patch)
tree0707676dd746da84e21f09a3bc962e8b34782482 /MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
parentec99fa8efb51379e722c6955bb66da3d3b721aea (diff)
Return empty string when END device path is passed in to align the original behavior in order to keep backward compatibility.
Signed-off-by: niruiyu Reviewed-by: erictian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12402 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c')
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
index d169c4d0d..d7cff207f 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
@@ -1875,6 +1875,7 @@ ConvertDeviceNodeToText (
//
DumpNode (&Str, (VOID *) DeviceNode, DisplayOnly, AllowShortcuts);
+ ASSERT (Str.Str != NULL);
return Str.Str;
}
@@ -1959,5 +1960,9 @@ ConvertDevicePathToText (
DevPathNode = NextDevicePathNode (DevPathNode);
}
- return Str.Str;
+ if (Str.Str == NULL) {
+ return AllocateZeroPool (sizeof (CHAR16));
+ } else {
+ return Str.Str;
+ }
}