From: Pauli Date: Wed, 17 Mar 2021 03:35:59 +0000 (+1000) Subject: evp: fix coverity 1473381 - dereference after null check X-Git-Tag: openssl-3.0.0-alpha14~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6d1bd4eb8662fb89911d5823d9454ca924878e7;p=thirdparty%2Fopenssl.git evp: fix coverity 1473381 - dereference after null check Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/14589) --- diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c index 32af4eedd36..808804ab3a9 100644 --- a/crypto/evp/ctrl_params_translate.c +++ b/crypto/evp/ctrl_params_translate.c @@ -1512,8 +1512,14 @@ static int get_payload_group_name(enum state state, return 0; } - if (ctx->p2 != NULL) - ctx->p1 = strlen(ctx->p2); + /* + * Quietly ignoring unknown groups matches the behaviour on the provider + * side. + */ + if (ctx->p2 == NULL) + return 1; + + ctx->p1 = strlen(ctx->p2); return default_fixup_args(state, translation, ctx); }