diff options
author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 02:56:38 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 02:56:38 +0000 |
commit | 9d4af8fce232b371165eaf4f2c2275886c21ff2b (patch) | |
tree | 0707676dd746da84e21f09a3bc962e8b34782482 /MdeModulePkg/Universal | |
parent | ec99fa8efb51379e722c6955bb66da3d3b721aea (diff) | |
download | edk2-platforms-9d4af8fce232b371165eaf4f2c2275886c21ff2b.tar.xz |
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')
-rw-r--r-- | MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c index d169c4d0d5..d7cff207fe 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;
+ }
}
|