[PATCH] crypto: mbedtls: initialize maybe-uninitialized vars

6 views
Skip to first unread message

Bastian Germann

unread,
May 26, 2026, 1:47:26 PM (10 days ago) May 26
to swup...@googlegroups.com, Bastian Germann
Initialize md_attr_val and md_attr_len to silence -Wmaybe-uninitialized.

Signed-off-by: Bastian Germann <ba...@debian.org>
---
crypto/swupdate_pkcs7_verify_mbedtls.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/swupdate_pkcs7_verify_mbedtls.c b/crypto/swupdate_pkcs7_verify_mbedtls.c
index 361ffada..d354431f 100644
--- a/crypto/swupdate_pkcs7_verify_mbedtls.c
+++ b/crypto/swupdate_pkcs7_verify_mbedtls.c
@@ -452,8 +452,8 @@ static int pkcs7_verify_with_signed_attrs(unsigned char *sigbuf, size_t sigbuf_l
}

/* Step 2: messageDigest attribute must equal hash(content) */
- const unsigned char *md_attr_val;
- size_t md_attr_len;
+ const unsigned char *md_attr_val = NULL;
+ size_t md_attr_len = 0;
if (pkcs7_find_attr(sa_value, sa_value_len,
OID_MSG_DIGEST,
sizeof(OID_MSG_DIGEST) - 1,
Reply all
Reply to author
Forward
0 new messages