From: Philippe Reynes Date: Fri, 15 Oct 2021 09:28:47 +0000 (+0200) Subject: lib: rsa: rsa-verify: also check that padding is not NULL X-Git-Tag: v2022.01-rc1~11^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b560c704d66edf30c32c2a588bc1d177750bb418;p=pandora-u-boot.git lib: rsa: rsa-verify: also check that padding is not NULL This commit adds a check on the padding in the function rsa_verify_key to avoid using a NULL pointer. Signed-off-by: Philippe Reynes Reviewed-by: Simon Glass --- diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c index 600c93ab810..83f7564101c 100644 --- a/lib/rsa/rsa-verify.c +++ b/lib/rsa/rsa-verify.c @@ -340,7 +340,7 @@ static int rsa_verify_key(struct image_sign_info *info, struct padding_algo *padding = info->padding; int hash_len; - if (!prop || !sig || !hash || !checksum) + if (!prop || !sig || !hash || !checksum || !padding) return -EIO; if (sig_len != (prop->num_bits / 8)) {