
From: Junchong Pan <panjunchong@h-partners.com> Fix printf format issues and Null pointer dereference. Signed-off-by: Junchong Pan <panjunchong@h-partners.com> Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: JiangShui Yang <yangjiangshui@h-partners.com> --- src/uadk_digest.c | 2 +- src/uadk_ec.c | 2 +- src/uadk_prov_aead.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uadk_digest.c b/src/uadk_digest.c index c93b0ca..01d05ee 100644 --- a/src/uadk_digest.c +++ b/src/uadk_digest.c @@ -234,7 +234,7 @@ static int uadk_e_digests_soft_md(struct digest_priv_ctx *priv) SET_APP_DATASIZE(SHA512_CTX); break; default: - fprintf(stderr, "digest nid %d is invalid.\n", priv->e_nid); + fprintf(stderr, "digest nid %u is invalid.\n", priv->e_nid); return 0; } diff --git a/src/uadk_ec.c b/src/uadk_ec.c index b1dbdfe..aaf0127 100644 --- a/src/uadk_ec.c +++ b/src/uadk_ec.c @@ -1192,7 +1192,7 @@ static int ecdh_get_shared_key(const EC_KEY *ecdh, *out = OPENSSL_zalloc(*outlen); if (!*out) { - fprintf(stderr, "failed to alloc output key, outlen = %lu\n", + fprintf(stderr, "failed to alloc output key, outlen = %zu\n", *outlen); return 0; } diff --git a/src/uadk_prov_aead.c b/src/uadk_prov_aead.c index 6f33f43..ce71c15 100644 --- a/src/uadk_prov_aead.c +++ b/src/uadk_prov_aead.c @@ -421,7 +421,7 @@ static int uadk_prov_do_aes_gcm_first(struct aead_priv_ctx *priv, unsigned char int ret; if (inlen > MAX_AAD_LEN) { - fprintf(stderr, "the aad len is out of range, aad len = %lu.\n", inlen); + fprintf(stderr, "the aad len is out of range, aad len = %zu.\n", inlen); return UADK_AEAD_FAIL; } -- 2.33.0