[Python-checkins] r55146 - in python/branches/py3k-struni: Doc/api/concrete.tex Include/unicodeobject.h Objects/unicodeobject.c

Walter Dörwald walter at livinglogic.de
Sun May 6 12:01:01 CEST 2007


Neal Norwitz wrote:

> On 5/5/07, walter.doerwald <python-checkins at python.org> wrote:
>> Author: walter.doerwald
 >> [...]
>> Modified: python/branches/py3k-struni/Objects/unicodeobject.c
>> ============================================================================== 
>>
>> --- python/branches/py3k-struni/Objects/unicodeobject.c (original)
>> +++ python/branches/py3k-struni/Objects/unicodeobject.c Sat May  5 
>> 14:00:46 2007
>> @@ -393,6 +393,51 @@
>>      return (PyObject *)unicode;
>>  }
>>
>> +PyObject *PyUnicode_FromString(const char *u)
>> +{
>> +    PyUnicodeObject *unicode;
>> +    Py_ssize_t size = strlen(u);
> 
> This should check for overflow.  It's possible to have a 2+GB string
> on a 32-bit platform which would result in a negative size.

Done. Thanks for the hint.

Servus,
    Walter


More information about the Python-checkins mailing list