Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv22624/Misc Modified Files: NEWS Log Message: Double-fix of crash in Unicode freelist handling. 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. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.855 retrieving revision 1.856 diff -C2 -d -r1.855 -r1.856 *** NEWS 12 Sep 2003 06:33:36 -0000 1.855 --- NEWS 16 Sep 2003 19:41:38 -0000 1.856 *************** *** 13,16 **** --- 13,21 ---- ----------------- + - Fixed a bug in the cache of length-one Unicode strings that could + lead to a seg fault. The specific problem occurred when an earlier, + non-fatal error left an uninitialized Unicode object in the + freelist. + - The % formatting operator now supports '%F' which is equivalent to '%f'. This has always been documented but never implemented.