From 1ba4a4df3972cec30b2aa44ff9ff53e5f5eeddc1 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Thu, 22 Mar 2018 14:22:40 +0100 Subject: [PATCH] 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 --- NetworkPkg/HttpBootDxe/HttpBootDhcp4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.2