python/dist/src/Objects listobject.c,2.207,2.208

Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13639/Objects Modified Files: listobject.c Log Message: PyList_New(): we went to all the trouble of computing and bounds-checking the size_t nbytes, and passed nbytes to malloc, so it was confusing to effectively recompute the same thing from scratch in the memset call. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.207 retrieving revision 2.208 diff -C2 -d -r2.207 -r2.208 *** listobject.c 15 Jul 2004 15:54:05 -0000 2.207 --- listobject.c 29 Jul 2004 02:28:42 -0000 2.208 *************** *** 60,63 **** --- 60,64 ---- PyListObject *op; size_t nbytes; + if (size < 0) { PyErr_BadInternalCall(); *************** *** 83,87 **** if (op->ob_item == NULL) return PyErr_NoMemory(); ! memset(op->ob_item, 0, sizeof(*op->ob_item) * size); } op->ob_size = size; --- 84,88 ---- if (op->ob_item == NULL) return PyErr_NoMemory(); ! memset(op->ob_item, 0, nbytes); } op->ob_size = size;
participants (1)
-
tim_oneļ¼ users.sourceforge.net