1. Armin Rigo
  2. cpython-withatomic

Commits

Marc-André Lemburg  committed 1907ad5

Applied patch for [ 1047269 ] Buffer overwrite in PyUnicode_AsWideChar.

Python 2.3.x candidate.

  • Participants
  • Parent commits b308e15
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Objects/unicodeobject.c

View file
  • Ignore whitespace
 	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
 	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