Move an assert() to avoid core dumps when a static buffer hasn't been given.
authorRichard Levitte <levitte@openssl.org>
Thu, 9 May 2002 18:19:45 +0000 (18:19 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 9 May 2002 18:19:45 +0000 (18:19 +0000)
Notified by Verdon Walker <VWalker@novell.com>

crypto/bio/b_print.c

index b7e268f092011b94bc2697ebc3ef9403c4401899..92f9f8f4e69995aa9facd17addfdd83edab1c1b5 100644 (file)
@@ -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;