]> granicus.if.org Git - python/commitdiff
Fix PyUnicode_AsWideCharString(): set *size if size is not NULL
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 29 Sep 2010 17:55:12 +0000 (17:55 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 29 Sep 2010 17:55:12 +0000 (17:55 +0000)
Objects/unicodeobject.c

index 8ceb3f32b8bc97b8892f897e6cbd54b532c226b3..29404c3c26226855825ef8db076c0db3e7d8cf3c 100644 (file)
@@ -1215,6 +1215,8 @@ PyUnicode_AsWideCharString(PyUnicodeObject *unicode,
         return NULL;
     }
     unicode_aswidechar(unicode, buffer, buflen);
+    if (size)
+        *size = buflen;
     return buffer;
 }