mirror of
https://git.proxmox.com/git/grub2
synced 2025-08-13 21:16:08 +00:00
libgcrypt/mpi: Fix possible NULL dereference
The code in gcry_mpi_scan() assumes that buffer is not NULL, but there is no explicit check for that, so we add one. Fixes: CID 73757 Signed-off-by: Darren Kenny <darren.kenny@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
e8814c8111
commit
ae0f3fabeb
@ -379,6 +379,9 @@ gcry_mpi_scan (struct gcry_mpi **ret_mpi, enum gcry_mpi_format format,
|
|||||||
unsigned int len;
|
unsigned int len;
|
||||||
int secure = (buffer && gcry_is_secure (buffer));
|
int secure = (buffer && gcry_is_secure (buffer));
|
||||||
|
|
||||||
|
if (!buffer)
|
||||||
|
return gcry_error (GPG_ERR_INV_ARG);
|
||||||
|
|
||||||
if (format == GCRYMPI_FMT_SSH)
|
if (format == GCRYMPI_FMT_SSH)
|
||||||
len = 0;
|
len = 0;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user