[Python-checkins] python/dist/src/Objects stringobject.c,2.198,2.199

loewis@users.sourceforge.net loewis@users.sourceforge.net
Thu, 12 Dec 2002 12:03:23 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv15009/Objects

Modified Files:
	stringobject.c 
Log Message:
Patch #650653: Raise always value error if the table is not 256 bytes long.


Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.198
retrieving revision 2.199
diff -C2 -d -r2.198 -r2.199
*** stringobject.c	6 Dec 2002 12:48:52 -0000	2.198
--- stringobject.c	12 Dec 2002 20:03:19 -0000	2.199
***************
*** 2071,2074 ****
--- 2071,2080 ----
  		return NULL;
  
+ 	if (tablen != 256) {
+ 		PyErr_SetString(PyExc_ValueError,
+ 		  "translation table must be 256 characters long");
+ 		return NULL;
+ 	}
+ 
  	if (delobj != NULL) {
  		if (PyString_Check(delobj)) {
***************
*** 2085,2094 ****
  		else if (PyObject_AsCharBuffer(delobj, &del_table, &dellen))
  			return NULL;
- 
- 		if (tablen != 256) {
- 			PyErr_SetString(PyExc_ValueError,
- 			  "translation table must be 256 characters long");
- 			return NULL;
- 		}
  	}
  	else {
--- 2091,2094 ----