diff options
-rw-r--r-- | crypto/bio/b_print.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c index 08d43d3bd5..ba2c6c5b1f 100644 --- a/crypto/bio/b_print.c +++ b/crypto/bio/b_print.c @@ -835,9 +835,12 @@ doapr_outch(char **sbuffer, *sbuffer = NULL; } else { char *tmpbuf; + tmpbuf = OPENSSL_realloc(*buffer, *maxlen); - if (tmpbuf == NULL) + if (tmpbuf == NULL) { + ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE); return 0; + } *buffer = tmpbuf; } } @@ -929,6 +932,5 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) * been large enough.) */ return -1; - else - return (retlen <= INT_MAX) ? (int)retlen : -1; + return (retlen <= INT_MAX) ? (int)retlen : -1; } |