diff options
| author | tb <> | 2020-09-24 19:24:45 +0000 |
|---|---|---|
| committer | tb <> | 2020-09-24 19:24:45 +0000 |
| commit | 28f9589656367e65d19640878dfcca8e6601c20e (patch) | |
| tree | ab5225ad5a847b7bbea1878f55b4d1160bdb9588 | |
| parent | 52f9aecae4f1ab60ff1ec122577f0553c71ff6d8 (diff) | |
| download | openbsd-28f9589656367e65d19640878dfcca8e6601c20e.tar.gz openbsd-28f9589656367e65d19640878dfcca8e6601c20e.tar.bz2 openbsd-28f9589656367e65d19640878dfcca8e6601c20e.zip | |
Push ERR_R_MALLOC_FAILURE onto the error stack
If sk_UI_STRING_new_null() fails, this must be due to a memory error,
so signal this to the user.
ok jsing
| -rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index 27c7e5126f..32a56e581b 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.35 2020/09/24 19:22:18 tb Exp $ */ | 1 | /* $OpenBSD: ui_lib.c,v 1.36 2020/09/24 19:24:45 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 | */ |
| @@ -130,8 +130,8 @@ static int | |||
| 130 | allocate_string_stack(UI *ui) | 130 | allocate_string_stack(UI *ui) |
| 131 | { | 131 | { |
| 132 | if (ui->strings == NULL) { | 132 | if (ui->strings == NULL) { |
| 133 | ui->strings = sk_UI_STRING_new_null(); | 133 | if ((ui->strings = sk_UI_STRING_new_null()) == NULL) { |
| 134 | if (ui->strings == NULL) { | 134 | UIerror(ERR_R_MALLOC_FAILURE); |
| 135 | return -1; | 135 | return -1; |
| 136 | } | 136 | } |
| 137 | } | 137 | } |
