From b4000e8ad8ee40226d3080860bd4c70b79f42fcc Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 9 May 2002 18:19:21 +0000 Subject: [PATCH] Move an assert() to avoid core dumps when a static buffer hasn't been given. Notified by Verdon Walker --- crypto/bio/b_print.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c index b7e268f092..92f9f8f4e6 100644 --- a/crypto/bio/b_print.c +++ b/crypto/bio/b_print.c @@ -716,12 +716,13 @@ doapr_outch( if (buffer) { while (*currlen >= *maxlen) { if (*buffer == NULL) { - assert(*sbuffer != NULL); if (*maxlen == 0) *maxlen = 1024; *buffer = OPENSSL_malloc(*maxlen); - if (*currlen > 0) + if (*currlen > 0) { + assert(*sbuffer != NULL); memcpy(*buffer, *sbuffer, *currlen); + } *sbuffer = NULL; } else { *maxlen += 1024; -- 2.25.1