• Jeremy Hylton's avatar
    Double-fix of crash in Unicode freelist handling. · d808279b
    Jeremy Hylton yazdı
    If a length-1 Unicode string was in the freelist and it was
    uninitialized or pointed to a very large (magnitude) negative number,
    the check
    
    	 unicode_latin1[unicode->str[0]] == unicode
    
    could cause a segmentation violation, e.g. unicode->str[0] is 0xcbcbcbcb.
    
    Fix this in two ways:
    
    1. Change guard befor unicode_latin1[] to test against 256U.  If I
       understand correctly, the unsigned long used to store UCS4 on my
       box was getting converted to a signed long to compare with the
       signed constant 256.
    
    2. Change _PyUnicode_New() to make sure the first element of str is
       always initialized to zero.  There are several places in the code
       where the caller can exit with an error before initializing any
       of str, which would leave junk in str[0].
    
    Also, silence a compiler warning on pointer vs. int arithmetic.
    
    Bug fix candidate.
    d808279b
Adı
Son kayıt (commit)
Son güncelleme
..
RPM Loading commit data...
ACKS Loading commit data...
AIX-NOTES Loading commit data...
BeOS-NOTES Loading commit data...
BeOS-setup.py Loading commit data...
HISTORY Loading commit data...
NEWS Loading commit data...
NEWS.help Loading commit data...
PURIFY.README Loading commit data...
Porting Loading commit data...
README Loading commit data...
RFD Loading commit data...
SpecialBuilds.txt Loading commit data...
cheatsheet Loading commit data...
find_recursionlimit.py Loading commit data...
gdbinit Loading commit data...
indent.pro Loading commit data...
pymemcompat.h Loading commit data...
python-mode.el Loading commit data...
python.man Loading commit data...
setuid-prog.c Loading commit data...
vgrindefs Loading commit data...