[issue1950] Potential overflows due to incorrect usage of PyUnicode_AsString.

Alexandre Vassalotti report at bugs.python.org
Sat May 3 19:49:59 CEST 2008


Alexandre Vassalotti <alexandre at peadrop.com> added the comment:

Alexander Belopolsky wrote:
> The patch looks good.  Just a question: I thought the strings returned
> by PyUnicode_AsStringAndSize are 0-terminated, while your patch at
> several places attempts to explicitly 0-terminate a copy of such string.  
> Are you sure this is necessary?

I wasn't sure if the strings returned by PyUnicode_AsStringAndSize were
0-terminated, so I didn't take any chance and explicitly terminated
them. But I just verified myself and they are indeed 0-terminated. So, I
modified the patch in consequence.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1950>
__________________________________


More information about the Python-bugs-list mailing list