From 802d2243083a46fbb4afb15a78c3db07f0092af3 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 13 Apr 2016 02:40:39 +0200 Subject: [PATCH] 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 --- apps/enc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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"); -- 2.25.1