From 27f9d00efc10f7f43127baeed1e3315475422e69 Mon Sep 17 00:00:00 2001 From: eustas Date: Thu, 23 Jun 2016 11:02:53 +0200 Subject: Fix issue #383 --- python/brotlimodule.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/brotlimodule.cc b/python/brotlimodule.cc index de3f095..9e8c01a 100644 --- a/python/brotlimodule.cc +++ b/python/brotlimodule.cc @@ -174,7 +174,7 @@ static PyObject* brotli_compress(PyObject *self, PyObject *args, PyObject *keywd end: BrotliEncoderDestroyInstance(enc); if (ok) { - ret = PyBytes_FromStringAndSize((char*)output, output_length); + ret = PyBytes_FromStringAndSize((char*)output, output_length - available_out); } else { PyErr_SetString(BrotliError, "BrotliCompressBuffer failed"); } -- cgit v1.1