summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-05-09 18:19:21 +0000
committerRichard Levitte <levitte@openssl.org>2002-05-09 18:19:21 +0000
commitb4000e8ad8ee40226d3080860bd4c70b79f42fcc (patch)
treea44bb5fd54d7ef3070fa3e80e02d705ea3659011 /crypto/bio
parent21d5ed98d5a1a4ced3fdfec8b9b40260a8d55547 (diff)
Move an assert() to avoid core dumps when a static buffer hasn't been given.
Notified by Verdon Walker <VWalker@novell.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/b_print.c5
1 files 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;