From 9c77725653061baa9ae169a966205a4eb2f6c3fd Mon Sep 17 00:00:00 2001 From: gregorycu Date: Mon, 4 Jan 2016 18:02:12 +1100 Subject: [PATCH] Replace instance of readsome with read in decompressZlib Make decompressZlib more robust --- src/serialization.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/serialization.cpp b/src/serialization.cpp index c0fbe10e..79f66fca 100644 --- a/src/serialization.cpp +++ b/src/serialization.cpp @@ -133,7 +133,8 @@ void decompressZlib(std::istream &is, std::ostream &os) if(z.avail_in == 0) { z.next_in = (Bytef*)input_buffer; - input_buffer_len = is.readsome(input_buffer, bufsize); + is.read(input_buffer, bufsize); + input_buffer_len = is.gcount(); z.avail_in = input_buffer_len; //dstream<<"read fail="<