提交 b02f2e79 编写于 作者: P Philippe Reynes 提交者: Tom Rini

rsa: check that pointer checksum isn't NULL before using it

The pointer checksum were used before checking that it
isn't NULL. We move the code that use it after the check.

Reported-by: Coverity (CID: 185835)
Signed-off-by: NPhilippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 cfb3e102
......@@ -295,7 +295,7 @@ static int rsa_verify_key(struct image_sign_info *info,
#endif
struct checksum_algo *checksum = info->checksum;
struct padding_algo *padding = info->padding;
int hash_len = checksum->checksum_len;
int hash_len;
if (!prop || !sig || !hash || !checksum)
return -EIO;
......@@ -315,6 +315,7 @@ static int rsa_verify_key(struct image_sign_info *info,
}
uint8_t buf[sig_len];
hash_len = checksum->checksum_len;
#if !defined(USE_HOSTCC)
ret = uclass_get_device(UCLASS_MOD_EXP, 0, &mod_exp_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册