[issue5108] Invalid UTF-8 ("%s") length in PyUnicode_FromFormatV()

Walter Dörwald <report@bugs.python.org> at psf.upfronthosting.co.za Walter Dörwald <report@bugs.python.org> at psf.upfronthosting.co.za
Thu Apr 9 23:26:07 CEST 2009


Walter Dörwald <walter at livinglogic.de> added the comment:

The problem with your patch is that it calls PyUnicode_DecodeUTF8()
twice. It would be better if step 1 in the code would include the %s
format specifiers and step 3 would then call PyUnicode_DecodeUTF8() and
put the result into the callresults buffer.

BTW, I can't make your examples segfault.

Attached is a new version of the patch that implements this. Could you
test this new version to see if there's still a Valgrind report?

----------
nosy: +doerwalter
Added file: http://bugs.python.org/file13668/diff.txt

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5108>
_______________________________________


More information about the Python-bugs-list mailing list