From df4c129833ab5a94a4920620938e32979cf2f241 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 2 Aug 2018 09:14:59 +0800 Subject: [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the return buffers Add NULL check to the return buffers from GetFmpHandleBufferByType(). Cc: Jiewen Yao Cc: Hao A Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Hao A Wu --- MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index 85848279d4..91c6849a46 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -1225,7 +1225,9 @@ ProcessFmpCapsuleImage ( &HandleBuffer, &ResetRequiredBuffer ); - if (EFI_ERROR(Status)) { + if (EFI_ERROR(Status) || + (HandleBuffer == NULL) || + (ResetRequiredBuffer == NULL)) { NotReady = TRUE; RecordFmpCapsuleStatus ( NULL, -- 2.39.2