From b371a682fb67ff945a8095437b9b33cab549bb49 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Thu, 13 Oct 2016 15:57:25 +0800 Subject: Update to openssl 1.0.2j Signed-off-by: Gary Lin --- Cryptlib/OpenSSL/crypto/bio/b_print.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Cryptlib/OpenSSL/crypto/bio/b_print.c') diff --git a/Cryptlib/OpenSSL/crypto/bio/b_print.c b/Cryptlib/OpenSSL/crypto/bio/b_print.c index dfc26bcd..fea73864 100644 --- a/Cryptlib/OpenSSL/crypto/bio/b_print.c +++ b/Cryptlib/OpenSSL/crypto/bio/b_print.c @@ -431,9 +431,15 @@ _dopr(char **sbuffer, break; } } - *truncated = (currlen > *maxlen - 1); - if (*truncated) - currlen = *maxlen - 1; + /* + * We have to truncate if there is no dynamic buffer and we have filled the + * static buffer. + */ + if (buffer == NULL) { + *truncated = (currlen > *maxlen - 1); + if (*truncated) + currlen = *maxlen - 1; + } if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0')) return 0; *retlen = currlen - 1; -- cgit v1.2.3