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: v3.4.4rc1~5^2~10^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aed198426a3b1186633295cd4a6160ab4423e069;p=python Issue #23055: Fixed read-past-the-end error in PyUnicode_FromFormatV. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1d1d5313c3..090cc1f4b1 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; }