sha1_file: correct zlib buffer handling