diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index f323b83c94..ce58321eb0 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -193,10 +193,11 @@ PxeBcParseCachedDhcpPacket ( // RFC 2132, Section 9.5 does not strictly state Bootfile name (option 67) is null // terminated string. So force to append null terminated character at the end of string. // - ASSERT (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL); - Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0]; - Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length; - *Ptr8 = '\0'; + if (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) { + Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0]; + Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length; + *Ptr8 = '\0'; + } } else if ((Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) && (Offer->Dhcp4.Header.BootFileName[0] != 0)) {