diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/err/err_prn.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c index d60cfdcb92..16d8862a82 100644 --- a/src/lib/libcrypto/err/err_prn.c +++ b/src/lib/libcrypto/err/err_prn.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: err_prn.c,v 1.20 2023/07/07 13:54:45 beck Exp $ */ | 1 | /* $OpenBSD: err_prn.c,v 1.21 2024/01/10 14:22:53 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -56,6 +56,7 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <limits.h> | ||
| 59 | #include <stdio.h> | 60 | #include <stdio.h> |
| 60 | #include <string.h> | 61 | #include <string.h> |
| 61 | 62 | ||
| @@ -93,12 +94,9 @@ LCRYPTO_ALIAS(ERR_print_errors_cb); | |||
| 93 | static int | 94 | static int |
| 94 | print_fp(const char *str, size_t len, void *fp) | 95 | print_fp(const char *str, size_t len, void *fp) |
| 95 | { | 96 | { |
| 96 | BIO bio; | 97 | if (len > INT_MAX) |
| 97 | 98 | return -1; | |
| 98 | BIO_set(&bio, BIO_s_file()); | 99 | return fprintf(fp, "%.*s", (int)len, str); |
| 99 | BIO_set_fp(&bio, fp, BIO_NOCLOSE); | ||
| 100 | |||
| 101 | return BIO_printf(&bio, "%s", str); | ||
| 102 | } | 100 | } |
| 103 | 101 | ||
| 104 | void | 102 | void |
