From 199c9a6f4bf6ff6fe04c4c4ca17c24bc258079f7 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 14 Oct 2015 09:47:23 +0200 Subject: Fix long_format_binary() Issue #25399: Fix long_format_binary(), allocate bytes for the bytes writer. --- Objects/longobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/longobject.c b/Objects/longobject.c index 00f5d95..759116a 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; -- cgit v0.12