NetworkPkg: Fix suspicious dereference of pointer 'FieldCount'
authorJiaxin Wu <jiaxin.wu@intel.com>
Tue, 8 Sep 2015 02:01:05 +0000 (02:01 +0000)
committerjiaxinwu <jiaxinwu@Edk2>
Tue, 8 Sep 2015 02:01:05 +0000 (02:01 +0000)
This patch is used to fix suspicious dereference of pointer 'FieldCount'
before NULL check.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18409 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c

index 8c29f20..a83c963 100644 (file)
@@ -307,7 +307,6 @@ HttpUtilitiesParse (
   \r
   Status          = EFI_SUCCESS;\r
   TempHttpMessage = NULL;\r
-  *FieldCount     = 0;\r
   Token           = NULL;\r
   NextToken       = NULL;\r
   FieldName       = NULL;\r
@@ -328,6 +327,7 @@ HttpUtilitiesParse (
   //\r
   // Get header number\r
   //\r
+  *FieldCount = 0;\r
   Token = TempHttpMessage;\r
   while (TRUE) {\r
     FieldName     = NULL;\r