[Python-checkins] CVS: python/dist/src/Python mysnprintf.c,2.1,2.2
Tim Peters
tim_one@users.sourceforge.net
2001年7月31日 15:10:31 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv9732/python/dist/src/Python
Modified Files:
mysnprintf.c
Log Message:
Add mysnprintf.c to Windows build, + squash compiler wngs in mysnprintf.c.
Index: mysnprintf.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/mysnprintf.c,v
retrieving revision 2.1
retrieving revision 2.2
diff -C2 -d -r2.1 -r2.2
*** mysnprintf.c 2001年07月31日 13:24:44 2.1
--- mysnprintf.c 2001年07月31日 22:10:29 2.2
***************
*** 38,44 ****
}
len++;
! if (len > size + 512)
Py_FatalError("Buffer overflow in PyOS_snprintf/PyOS_vsnprintf");
! if (len > size) {
PyMem_Free(buffer);
return len - 1;
--- 38,45 ----
}
len++;
! assert(len >= 0);
! if ((size_t)len > size + 512)
Py_FatalError("Buffer overflow in PyOS_snprintf/PyOS_vsnprintf");
! if ((size_t)len > size) {
PyMem_Free(buffer);
return len - 1;