From: Serhiy Storchaka Date: Fri, 30 Jan 2015 23:15:48 +0000 (+0200) Subject: Issue #23055: Fixed read-past-the-end error in PyUnicode_FromFormatV. X-Git-Tag: 3.2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aed198426a3b1186633295cd4a6160ab4423e069;p=thirdparty%2FPython%2Fcpython.git Issue #23055: Fixed read-past-the-end error in PyUnicode_FromFormatV. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1d1d5313c348..090cc1f4b13a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -762,6 +762,8 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) f++; while (*f && *f != '%' && !Py_ISALPHA((unsigned)*f)) f++; + if (!*f) + break; if (*f == 's' || *f=='S' || *f=='R' || *f=='A' || *f=='V') ++callcount; }