summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-01-30 23:15:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-01-30 23:15:48 (GMT)
commitaed198426a3b1186633295cd4a6160ab4423e069 (patch)
treeacc6dd19ff79228c5df5e4ae258b90e63afe40c7
parent3f95292be69ac09ed173e4241d220d30b1b059ff (diff)
downloadcpython-aed198426a3b1186633295cd4a6160ab4423e069.zip
cpython-aed198426a3b1186633295cd4a6160ab4423e069.tar.gz
cpython-aed198426a3b1186633295cd4a6160ab4423e069.tar.bz2
Issue #23055: Fixed read-past-the-end error in PyUnicode_FromFormatV.
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1d1d531..090cc1f 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;
}