mirror of https://github.com/acidanthera/audk.git
BaseTools/DevicePath: Fix potential null pointer dereference
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
66329d53bd
commit
e73fbac5d7
|
@ -183,6 +183,11 @@ int main(int argc, CHAR8 *argv[])
|
|||
}
|
||||
Ascii2UnicodeString(Str, Str16);
|
||||
DevicePath = UefiDevicePathLibConvertTextToDevicePath(Str16);
|
||||
if (DevicePath == NULL) {
|
||||
fprintf(stderr, "Convert fail, Cannot convert text to a device path");
|
||||
free(Str16);
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
while (!((DevicePath->Type == END_DEVICE_PATH_TYPE) && (DevicePath->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)) )
|
||||
{
|
||||
PrintMem (DevicePath, DevicePath->Length[0] | DevicePath->Length[1] << 8);
|
||||
|
|
Loading…
Reference in New Issue