Add null pointer check of 'siglen' parameter.
Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- src/uadk_ec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/uadk_ec.c b/src/uadk_ec.c index 400040e..b1dbdfe 100644 --- a/src/uadk_ec.c +++ b/src/uadk_ec.c @@ -548,8 +548,11 @@ static int ecdsa_sign(int type, const unsigned char *dgst, int dlen, goto err; }
- *siglen = i2d_ECDSA_SIG(s, &sig); + if (siglen) + *siglen = i2d_ECDSA_SIG(s, &sig); + ECDSA_SIG_free(s); + return 1;
err: