[Python-checkins] python/dist/src/Modules unicodedata.c, 2.28.10.1, 2.28.10.2

loewis at users.sourceforge.net loewis at users.sourceforge.net
Sat Apr 17 15:36:15 EDT 2004


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31435/Modules

Modified Files:
      Tag: release23-maint
	unicodedata.c 
Log Message:
Special case normalization of empty strings. Fixes #924361.


Index: unicodedata.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v
retrieving revision 2.28.10.1
retrieving revision 2.28.10.2
diff -C2 -d -r2.28.10.1 -r2.28.10.2
*** unicodedata.c	6 Nov 2003 20:47:43 -0000	2.28.10.1
--- unicodedata.c	17 Apr 2004 19:36:13 -0000	2.28.10.2
***************
*** 516,519 ****
--- 516,526 ----
          return NULL;
  
+     if (PyUnicode_GetSize(input) == 0) {
+         /* Special case empty input strings, since resizing
+            them  later would cause internal errors. */
+         Py_INCREF(input);
+         return input;
+     }
+ 
      if (strcmp(form, "NFC") == 0)
          return nfc_nfkc(input, 0);




More information about the Python-checkins mailing list