From: Victor Stinner Date: Wed, 14 Oct 2015 07:47:23 +0000 (+0200) Subject: Fix long_format_binary() X-Git-Tag: v3.6.0a1~1228 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=199c9a6f4bf6ff6fe04c4c4ca17c24bc258079f7;p=python Fix long_format_binary() Issue #25399: Fix long_format_binary(), allocate bytes for the bytes writer. --- diff --git a/Objects/longobject.c b/Objects/longobject.c index 00f5d95390..759116a94c 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1836,7 +1836,7 @@ long_format_binary(PyObject *aa, int base, int alternate, kind = writer->kind; v = NULL; } - else if (writer) { + else if (bytes_writer) { *bytes_str = _PyBytesWriter_Prepare(bytes_writer, *bytes_str, sz); if (*bytes_str == NULL) return -1;