Add explicit check for correct next character in format at end of
format. This will complain about illegal formats like "O#" instead of ignoring the '#'.
This commit is contained in:
parent
eefcba61f4
commit
231a41e708
|
@ -256,6 +256,13 @@ vgetargs1(args, format, p_va, compat)
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (*format != '\0' && !isalpha(*format) &&
|
||||
*format != '|' && *format != ':' && *format != ';') {
|
||||
PyErr_Format(PyExc_SystemError,
|
||||
"bad format string: %s", formatsave);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue