Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d6b49e

Browse files
committed
Protect PyErr_Format format string argument from overflow (ironically,
the error was about a bad format string :-).
1 parent db93516 commit 0d6b49e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/getargs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ vgetargs1(args, format, p_va, compat)
261261
*format != '(' &&
262262
*format != '|' && *format != ':' && *format != ';') {
263263
PyErr_Format(PyExc_SystemError,
264-
"bad format string: %s", formatsave);
264+
"bad format string: %.200s", formatsave);
265265
return 0;
266266
}
267267

0 commit comments

Comments
 (0)