summaryrefslogtreecommitdiffstats
path: root/src/crypto/bio/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/bio/printf.c')
-rw-r--r--src/crypto/bio/printf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/crypto/bio/printf.c b/src/crypto/bio/printf.c
index 2f5ae4a..3709fcb 100644
--- a/src/crypto/bio/printf.c
+++ b/src/crypto/bio/printf.c
@@ -87,7 +87,11 @@ int BIO_printf(BIO *bio, const char *format, ...) {
}
#endif
- if (out_len >= sizeof(buf)) {
+ if (out_len < 0) {
+ return -1;
+ }
+
+ if ((size_t) out_len >= sizeof(buf)) {
const int requested_len = out_len;
/* The output was truncated. Note that vsnprintf's return value
* does not include a trailing NUL, but the buffer must be sized