Kaydet (Commit) 204bd6d9 authored tarafından Marc-André Lemburg's avatar Marc-André Lemburg

Applied patch for [ 1047269 ] Buffer overwrite in PyUnicode_AsWideChar.

Python 2.3.x candidate.
üst 5e7d51b6
...@@ -368,7 +368,7 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w, ...@@ -368,7 +368,7 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w,
register Py_UNICODE *u; register Py_UNICODE *u;
register int i; register int i;
u = PyUnicode_AS_UNICODE(unicode); u = PyUnicode_AS_UNICODE(unicode);
for (i = size; i >= 0; i--) for (i = size; i > 0; i--)
*u++ = *w++; *u++ = *w++;
} }
#endif #endif
...@@ -393,7 +393,7 @@ int PyUnicode_AsWideChar(PyUnicodeObject *unicode, ...@@ -393,7 +393,7 @@ int PyUnicode_AsWideChar(PyUnicodeObject *unicode,
register Py_UNICODE *u; register Py_UNICODE *u;
register int i; register int i;
u = PyUnicode_AS_UNICODE(unicode); u = PyUnicode_AS_UNICODE(unicode);
for (i = size; i >= 0; i--) for (i = size; i > 0; i--)
*w++ = *u++; *w++ = *u++;
} }
#endif #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