mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
Fix a bug:
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. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10635 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
be757a7fb5
commit
4546bcbb3a
@ -135,6 +135,7 @@ PxeBcParseCachedDhcpPacket (
|
|||||||
EFI_DHCP4_PACKET_OPTION *Option;
|
EFI_DHCP4_PACKET_OPTION *Option;
|
||||||
UINT8 OfferType;
|
UINT8 OfferType;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
UINT8 *Ptr8;
|
||||||
|
|
||||||
CachedPacket->IsPxeOffer = FALSE;
|
CachedPacket->IsPxeOffer = FALSE;
|
||||||
ZeroMem (CachedPacket->Dhcp4Option, sizeof (CachedPacket->Dhcp4Option));
|
ZeroMem (CachedPacket->Dhcp4Option, sizeof (CachedPacket->Dhcp4Option));
|
||||||
@ -188,6 +189,14 @@ PxeBcParseCachedDhcpPacket (
|
|||||||
sizeof (Offer->Dhcp4.Header.BootFileName),
|
sizeof (Offer->Dhcp4.Header.BootFileName),
|
||||||
PXEBC_DHCP4_TAG_BOOTFILE
|
PXEBC_DHCP4_TAG_BOOTFILE
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// 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';
|
||||||
|
|
||||||
} else if ((Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) &&
|
} else if ((Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) &&
|
||||||
(Offer->Dhcp4.Header.BootFileName[0] != 0)) {
|
(Offer->Dhcp4.Header.BootFileName[0] != 0)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user