Skip to content

Commit aed1984

Browse files
Issue python#23055: Fixed read-past-the-end error in PyUnicode_FromFormatV.
1 parent 3f95292 commit aed1984

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Objects/unicodeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
762762
f++;
763763
while (*f && *f != '%' && !Py_ISALPHA((unsigned)*f))
764764
f++;
765+
if (!*f)
766+
break;
765767
if (*f == 's' || *f=='S' || *f=='R' || *f=='A' || *f=='V')
766768
++callcount;
767769
}

0 commit comments

Comments
 (0)