]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
NetworkPkg/HttpDxe: Fix the potential NULL dereference
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index 77aa64a2b99668ef6b65920e6820d3c665615332..d19f73348d4931d3058bf6afbbca03e5bd4aed1e 100644 (file)
@@ -591,10 +591,12 @@ EfiHttpRequest (
 \r
   Status = HttpGenRequestMessage (HttpMsg, FileUrl, &RequestMsg, &RequestMsgSize);\r
 \r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || NULL == RequestMsg) {\r
     goto Error3;\r
   }\r
 \r
+  ASSERT (RequestMsg != NULL);\r
+\r
   //\r
   // Every request we insert a TxToken and a response call would remove the TxToken.\r
   // In cases of PUT/POST, after an initial request-response pair, we would do a\r