Issue #23055: Fixed a buffer overflow in PyUnicode_FromFormatV. Analysis

and fix by Guido Vranken.
This commit is contained in:
Serhiy Storchaka 2015-01-27 22:18:46 +02:00
parent 119479f705
commit 4dbc305002
3 changed files with 131 additions and 40 deletions

View file

@ -2335,6 +2335,8 @@ parse_format_flags(const char *f,
f--;
}
}
if (width < precision)
width = precision;
if (*f == '\0') {
/* bogus format "%.1" => go backward, f points to "1" */
f--;