From e1982d4ca9c7f337e6055fcb38931bd96f3f9903 Mon Sep 17 00:00:00 2001 From: sfu5 Date: Wed, 23 Nov 2011 05:05:12 +0000 Subject: [PATCH] Add pointer check for NULL before dereference it. Signed-off-by: sfu5 Reviewed-by: gdong1 Reviewed-by : czhan46 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12764 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c index 65ab5ac702..b3ac646446 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c @@ -1621,7 +1621,9 @@ DhcpOnTimerTick ( goto END_SESSION; } - Instance->ElaspedTime= 0; + if (Instance != NULL) { + Instance->ElaspedTime= 0; + } Status = DhcpSendMessage ( DhcpSb, @@ -1643,7 +1645,9 @@ DhcpOnTimerTick ( goto END_SESSION; } - Instance->ElaspedTime= 0; + if (Instance != NULL) { + Instance->ElaspedTime= 0; + } Status = DhcpSendMessage ( DhcpSb,