]> git.proxmox.com Git - mirror_edk2.git/commit - NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c
NetworkPkg: Fix possible infinite loop in HTTP msg body parser
authorVladimir Olovyannikov via groups.io <vladimir.olovyannikov=broadcom.com@groups.io>
Fri, 28 Aug 2020 18:17:06 +0000 (11:17 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 9 Oct 2020 10:40:33 +0000 (10:40 +0000)
commit70c2f10fde5b67b0d7d62ba7ea3271fc514ebcc4
tree0f60ad37c10a84616e57d183d4762810a5db3413
parent5df413119ec80cb462bf9c888ef5574f8ce8ae2e
NetworkPkg: Fix possible infinite loop in HTTP msg body parser

When an HTTP server sends a non-chunked body data with no
Content-Length header, the HttpParserMessageBody in DxeHttpLib
gets confused and never sets the Char pointer beyond the body start.
This causes "for" loop to never break because the condition of
"Char >= Body + BodyLength" is never satisfied.
Use BodyLength as the ContentLength for the parser when
ContentLength is absent in HTTP response headers.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2941

Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c