diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-17 13:35:59 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-20 10:18:32 +1000 |
commit | b6d1bd4eb8662fb89911d5823d9454ca924878e7 (patch) | |
tree | 4b8ecf595913132203122dc249c45c99048645fe /crypto/evp/ctrl_params_translate.c | |
parent | 72ded6f2a93085f536b4a820ab42b2da26fecf1c (diff) |
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/ctrl_params_translate.c')
-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); } |