Commit 23ce69b3 authored by Marc-André Lemburg's avatar Marc-André Lemburg

Applied patch for [ 1047269 ] Buffer overwrite in PyUnicode_AsWideChar.

Python 2.3.x candidate.
parent 4f1815fd
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment