diff options
Diffstat (limited to 'MdePkg/Library/UefiDevicePathLib/DevicePathToText.c')
-rw-r--r-- | MdePkg/Library/UefiDevicePathLib/DevicePathToText.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index afbd590787..e827daed5a 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -1842,7 +1842,11 @@ DevPathToTextUri ( Uri = DevPath;
UriLength = DevicePathNodeLength (Uri) - sizeof (URI_DEVICE_PATH);
UriStr = AllocatePool (UriLength + 1);
- ASSERT (UriStr != NULL);
+
+ if (UriStr == NULL) {
+ ASSERT (UriStr != NULL);
+ return;
+ }
CopyMem (UriStr, Uri->Uri, UriLength);
UriStr[UriLength] = '\0';
|