From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 811DE21B02822 for ; Mon, 14 Jan 2019 17:26:19 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 17:26:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,479,1539673200"; d="scan'208";a="108265570" Received: from jiaxinwu-mobl.ccr.corp.intel.com ([10.239.193.52]) by orsmga006.jf.intel.com with ESMTP; 14 Jan 2019 17:26:17 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Wu Hao A , Gao Liming , Ye Ting , Fu Siyuan , Wu Jiaxin Date: Tue, 15 Jan 2019 09:26:11 +0800 Message-Id: <20190115012613.16748-1-Jiaxin.wu@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 Subject: [PATCH v1 0/2] Fix the possible NULL pointer dereference issue. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2019 01:26:20 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1456 For the NET_LIST_FOR_EACH & NET_LIST_FOR_EACH_SAFE, "Entry" should be checked whether it's NULL or not instead of using the pointer directly. Besides, NET_LIST_FOR_EACH_SAFE is defined to iterate through the double linked list in delete-safe way. It's unnecessary to use this macro if list entries won't be deleted. Cc: Wu Hao A Cc: Gao Liming Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin Jiaxin Wu (2): MdeModulePkg/NetLib.h: Fix the possible NULL pointer dereference issue. MdeModulePkg/Dhcp4Dxe: Use NET_LIST_FOR_EACH instead of NET_LIST_FOR_EACH_SAFE. MdeModulePkg/Include/Library/NetLib.h | 6 +++--- MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) -- 2.17.1.windows.2