mirror of
https://github.com/python/cpython.git
synced 2025-07-16 07:45:20 +00:00
Add mysnprintf.c to Windows build, + squash compiler wngs in mysnprintf.c.
This commit is contained in:
parent
03d1b1814b
commit
aa6111fc93
2 changed files with 18 additions and 2 deletions
|
@ -37,9 +37,10 @@ int myvsnprintf(char *str, size_t size, const char *format, va_list va)
|
|||
return len;
|
||||
}
|
||||
len++;
|
||||
if (len > size + 512)
|
||||
assert(len >= 0);
|
||||
if ((size_t)len > size + 512)
|
||||
Py_FatalError("Buffer overflow in PyOS_snprintf/PyOS_vsnprintf");
|
||||
if (len > size) {
|
||||
if ((size_t)len > size) {
|
||||
PyMem_Free(buffer);
|
||||
return len - 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue