]> granicus.if.org Git - python/commitdiff
Fix long_format_binary()
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 14 Oct 2015 07:47:23 +0000 (09:47 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 14 Oct 2015 07:47:23 +0000 (09:47 +0200)
Issue #25399: Fix long_format_binary(), allocate bytes for the bytes writer.

Objects/longobject.c

index 00f5d95390eeedaaf34aaf5e6e975c902da3cda1..759116a94c063d269cfbde2cf6a8de0fd534a59f 100644 (file)
@@ -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;