mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
Applied patch for [ 1047269 ] Buffer overwrite in PyUnicode_AsWideChar.
Python 2.3.x candidate.
This commit is contained in:
parent
5e7d51b62c
commit
204bd6d9d2
1 changed files with 2 additions and 2 deletions
|
@ -368,7 +368,7 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w,
|
|||
register Py_UNICODE *u;
|
||||
register int i;
|
||||
u = PyUnicode_AS_UNICODE(unicode);
|
||||
for (i = size; i >= 0; i--)
|
||||
for (i = size; i > 0; i--)
|
||||
*u++ = *w++;
|
||||
}
|
||||
#endif
|
||||
|
@ -393,7 +393,7 @@ int PyUnicode_AsWideChar(PyUnicodeObject *unicode,
|
|||
register Py_UNICODE *u;
|
||||
register int i;
|
||||
u = PyUnicode_AS_UNICODE(unicode);
|
||||
for (i = size; i >= 0; i--)
|
||||
for (i = size; i > 0; i--)
|
||||
*w++ = *u++;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue