Blame SOURCES/0411-libgcrypt-mpi-Fix-possible-NULL-dereference.patch

9723a8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
9723a8
From: Darren Kenny <darren.kenny@oracle.com>
9723a8
Date: Thu, 26 Nov 2020 10:41:54 +0000
9723a8
Subject: [PATCH] libgcrypt/mpi: Fix possible NULL dereference
9723a8
9723a8
The code in gcry_mpi_scan() assumes that buffer is not NULL, but there
9723a8
is no explicit check for that, so we add one.
9723a8
9723a8
Fixes: CID 73757
9723a8
9723a8
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
9723a8
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
9723a8
---
9723a8
 grub-core/lib/libgcrypt/mpi/mpicoder.c | 3 +++
9723a8
 1 file changed, 3 insertions(+)
9723a8
9723a8
diff --git a/grub-core/lib/libgcrypt/mpi/mpicoder.c b/grub-core/lib/libgcrypt/mpi/mpicoder.c
b71686
index 7ecad27b2..6fe389165 100644
9723a8
--- a/grub-core/lib/libgcrypt/mpi/mpicoder.c
9723a8
+++ b/grub-core/lib/libgcrypt/mpi/mpicoder.c
9723a8
@@ -379,6 +379,9 @@ gcry_mpi_scan (struct gcry_mpi **ret_mpi, enum gcry_mpi_format format,
9723a8
   unsigned int len;
9723a8
   int secure = (buffer && gcry_is_secure (buffer));
9723a8
 
9723a8
+  if (!buffer)
9723a8
+    return gcry_error (GPG_ERR_INV_ARG);
9723a8
+
9723a8
   if (format == GCRYMPI_FMT_SSH)
9723a8
     len = 0;
9723a8
   else