Applied patch for [ 1047269 ] Buffer overwrite in PyUnicode_AsWideChar.
Python 2.3.x candidate.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 670fca4..48821bd 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -368,7 +368,7 @@
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 @@
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