diff options
author | Marc-André Lemburg <mal@egenix.com> | 2004-10-15 07:45:05 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2004-10-15 07:45:05 (GMT) |
commit | 204bd6d9d2c7aa6c49ed9f6edd1ed12489ba972b (patch) | |
tree | e766fc408f6e78f57b1affbbf6f62255c37d7d5e /Objects/unicodeobject.c | |
parent | 5e7d51b62cc86314987b833a2a800b9528e906d7 (diff) | |
download | cpython-204bd6d9d2c7aa6c49ed9f6edd1ed12489ba972b.zip cpython-204bd6d9d2c7aa6c49ed9f6edd1ed12489ba972b.tar.gz cpython-204bd6d9d2c7aa6c49ed9f6edd1ed12489ba972b.tar.bz2 |
Applied patch for [ 1047269 ] Buffer overwrite in PyUnicode_AsWideChar.
Python 2.3.x candidate.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ 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 |