[edk2] [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the return buffers

Star Zeng posted 1 patch 5 years, 8 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[edk2] [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the return buffers
Posted by Star Zeng 5 years, 8 months ago
Add NULL check to the return buffers from GetFmpHandleBufferByType().

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Hao A Wu <Hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 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 85848279d44c..91c6849a4658 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.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the return buffers
Posted by Wu, Hao A 5 years, 8 months ago
Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: Zeng, Star
> Sent: Thursday, August 02, 2018 9:16 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star; Yao, Jiewen; Wu, Hao A
> Subject: [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the
> return buffers
> 
> Add NULL check to the return buffers from GetFmpHandleBufferByType().
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Hao A Wu <Hao.a.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  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 85848279d44c..91c6849a4658 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.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel