summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorndossche <niels.dossche@ugent.be>2023-01-30 15:24:01 +0100
committerTomas Mraz <tomas@openssl.org>2023-02-08 16:56:44 +0100
commitb887310c59baf223b860d73bd01c63f888e5fc3f (patch)
tree6f9ee6f41823c54c59f513fa79c10727143cf808
parent9b77bd92f898d7ee6a9f135eb39d84591452f330 (diff)
Fix error check on default_check() helper function
default_check() can return a zero value to indicate an internal error in one condition for the PRE_CTRL_STR_TO_PARAMS state. This state can be reached from the default_fixup_args() function which does not check for a zero value. All other callers of default_check() in that file do check for a zero return value. Fix it by changing the check to <= 0. CLA: trivial Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20175) (cherry picked from commit 650f0474282330e3eb2a3df0eff5864bbdcf5845)
-rw-r--r--crypto/evp/ctrl_params_translate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c
index c21a70c6d1..dbb0b43537 100644
--- a/crypto/evp/ctrl_params_translate.c
+++ b/crypto/evp/ctrl_params_translate.c
@@ -387,7 +387,7 @@ static int default_fixup_args(enum state state,
{
int ret;
- if ((ret = default_check(state, translation, ctx)) < 0)
+ if ((ret = default_check(state, translation, ctx)) <= 0)
return ret;
switch (state) {