From: Richard Levitte Date: Wed, 13 Apr 2016 00:40:39 +0000 (+0200) Subject: Don't use FORMAT_BASE64 format when compressing / decompressing X-Git-Tag: OpenSSL_1_1_0-pre5~49 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=802d2243083a46fbb4afb15a78c3db07f0092af3;p=oweals%2Fopenssl.git Don't use FORMAT_BASE64 format when compressing / decompressing When compressing, the output / input is a binary format, not a text format like BASE64. This is important on Windows, where a ^Z in a text file is seen as EOF, and there could be a ^Z somewhere in a compressed file, cutting it short as input. Reviewed-by: Matt Caswell --- diff --git a/apps/enc.c b/apps/enc.c index 7869987bf1..7f25009ba9 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -313,12 +313,15 @@ int enc_main(int argc, char **argv) if (verbose) BIO_printf(bio_err, "bufsize=%d\n", bsize); - if (base64) { - if (enc) - outformat = FORMAT_BASE64; - else - informat = FORMAT_BASE64; - } +#ifdef ZLIB + if (!do_zlib) +#endif + if (base64) { + if (enc) + outformat = FORMAT_BASE64; + else + informat = FORMAT_BASE64; + } strbuf = app_malloc(SIZE, "strbuf"); buff = app_malloc(EVP_ENCODE_LENGTH(bsize), "evp buffer");