summaryrefslogtreecommitdiff
path: root/MdePkg/Library
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index 008ec0b96c..37d7a1752b 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -567,7 +567,9 @@ DevPathFromTextGenericPath (
(UINT16) (sizeof (EFI_DEVICE_PATH_PROTOCOL) + DataLength)
);
- StrToBuf ((UINT8 *) (Node + 1), DataLength, DataStr);
+ if (DataLength != 0) {
+ StrToBuf ((UINT8 *) (Node + 1), DataLength, DataStr);
+ }
return Node;
}