diff options
| author | tb <> | 2020-09-24 19:31:01 +0000 |
|---|---|---|
| committer | tb <> | 2020-09-24 19:31:01 +0000 |
| commit | 8e6f5d2de87e242ec34905337776aedd71040240 (patch) | |
| tree | 80348fc214b88d90b29a305f953eefef41c969b0 /src/lib/libcrypto/ui/ui_lib.c | |
| parent | 601e8c398115dd6a33daa6e87d334dc0624b0b6e (diff) | |
| download | openbsd-8e6f5d2de87e242ec34905337776aedd71040240.tar.gz openbsd-8e6f5d2de87e242ec34905337776aedd71040240.tar.bz2 openbsd-8e6f5d2de87e242ec34905337776aedd71040240.zip | |
Error out if ok_chars and cancel_chars overlap
It is a bit silly to push an error on the stack without erroring out,
so error out if the ok_chars and cancel_chars overlap.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
| -rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index e349cb3853..1045cb9992 100644 --- a/src/lib/libcrypto/ui/ui_lib.c +++ b/src/lib/libcrypto/ui/ui_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ui_lib.c,v 1.37 2020/09/24 19:29:09 tb Exp $ */ | 1 | /* $OpenBSD: ui_lib.c,v 1.38 2020/09/24 19:31:01 tb Exp $ */ |
| 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL |
| 3 | * project 2001. | 3 | * project 2001. |
| 4 | */ | 4 | */ |
| @@ -216,8 +216,10 @@ general_allocate_boolean(UI *ui, const char *prompt, const char *action_desc, | |||
| 216 | UIerror(ERR_R_PASSED_NULL_PARAMETER); | 216 | UIerror(ERR_R_PASSED_NULL_PARAMETER); |
| 217 | goto err; | 217 | goto err; |
| 218 | } | 218 | } |
| 219 | if (ok_chars[strcspn(ok_chars, cancel_chars)] != '\0') | 219 | if (ok_chars[strcspn(ok_chars, cancel_chars)] != '\0') { |
| 220 | UIerror(UI_R_COMMON_OK_AND_CANCEL_CHARACTERS); | 220 | UIerror(UI_R_COMMON_OK_AND_CANCEL_CHARACTERS); |
| 221 | goto err; | ||
| 222 | } | ||
| 221 | 223 | ||
| 222 | if ((s = general_allocate_prompt(prompt, dup_strings, type, input_flags, | 224 | if ((s = general_allocate_prompt(prompt, dup_strings, type, input_flags, |
| 223 | result_buf)) == NULL) | 225 | result_buf)) == NULL) |
