diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-17 04:35:59 +0100 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-20 01:18:32 +0100 |
commit | b6d1bd4eb8662fb89911d5823d9454ca924878e7 (patch) | |
tree | 4b8ecf595913132203122dc249c45c99048645fe /crypto/evp | |
parent | x509: coverity 1472673 & 1472693 - dereference after null checks (diff) | |
download | openssl-b6d1bd4eb8662fb89911d5823d9454ca924878e7.tar.xz openssl-b6d1bd4eb8662fb89911d5823d9454ca924878e7.zip |
evp: fix coverity 1473381 - dereference after null check
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14589)
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/ctrl_params_translate.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c index 32af4eedd3..808804ab3a 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); } |