summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-01-30 23:15:29 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-01-30 23:15:29 (GMT)
commit227526dc5c47151d3829823f39ba122e7a348ed1 (patch)
tree85da9eb90f072539782de571ad1036d0265af111 /Objects
parent5ec0bbf27dfef0d486dca1177d8c86f37969474e (diff)
downloadcpython-227526dc5c47151d3829823f39ba122e7a348ed1.zip
cpython-227526dc5c47151d3829823f39ba122e7a348ed1.tar.gz
cpython-227526dc5c47151d3829823f39ba122e7a348ed1.tar.bz2
Issue #23055: Fixed read-past-the-end error in PyUnicode_FromFormatV.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1e3b812..91e7524 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -738,6 +738,8 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
f++;
while (*f && *f != '%' && !isalpha((unsigned)*f))
f++;
+ if (!*f)
+ break;
if (*f == 's' || *f=='S' || *f=='R')
++callcount;
}