]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/HttpBootDxe: fix typo in DHCPv4 packet parsing
authorLaszlo Ersek <lersek@redhat.com>
Thu, 22 Mar 2018 13:22:40 +0000 (14:22 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 28 Mar 2018 11:07:07 +0000 (13:07 +0200)
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 <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
NetworkPkg/HttpBootDxe/HttpBootDhcp4.c

index 421ce6eda40e9db42c209c89e0215f1c383fffcd..229e6cb0ec6a73791a9c25a55ff30cb90caf31fc 100644 (file)
@@ -332,8 +332,8 @@ HttpBootParseDhcp4Packet (
   // The offer with "HTTPClient" is a Http offer.\r
   //\r
   Option = Options[HTTP_BOOT_DHCP4_TAG_INDEX_CLASS_ID];\r
-  if ((Option != NULL) && (Option->Length >= 9) &&\r
-      (CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 9) == 0)) {\r
+  if ((Option != NULL) && (Option->Length >= 10) &&\r
+      (CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 10) == 0)) {\r
     IsHttpOffer = TRUE;\r
   }\r
 \r