From: Laszlo Ersek Date: Thu, 22 Mar 2018 13:22:40 +0000 (+0100) Subject: NetworkPkg/HttpBootDxe: fix typo in DHCPv4 packet parsing X-Git-Tag: edk2-stable201903~2040 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=1ba4a4df3972cec30b2aa44ff9ff53e5f5eeddc1;hp=699a2c30cb6e74a55f0c3f67c376460f99c201ed NetworkPkg/HttpBootDxe: fix typo in DHCPv4 packet parsing The string "HTTPClient" has 10 non-NUL characters; the value 9 is a copy-paste leftover from "PXEClient". Check for all 10 characters in the vendor-class-identifier option when determining whether the DHCP offer is an HTTP offer. Cc: Jiaxin Wu Cc: Siyuan Fu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Fu Siyuan Reviewed-by: Jiaxin Wu --- diff --git a/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c b/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c index 421ce6eda4..229e6cb0ec 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c +++ b/NetworkPkg/HttpBootDxe/HttpBootDhcp4.c @@ -332,8 +332,8 @@ HttpBootParseDhcp4Packet ( // The offer with "HTTPClient" is a Http offer. // Option = Options[HTTP_BOOT_DHCP4_TAG_INDEX_CLASS_ID]; - if ((Option != NULL) && (Option->Length >= 9) && - (CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 9) == 0)) { + if ((Option != NULL) && (Option->Length >= 10) && + (CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 10) == 0)) { IsHttpOffer = TRUE; }