Commit dc5eff91 authored by Tim Peters's avatar Tim Peters

vgetargskeywords: Prevent another potential sprintf buffer overrun.

parent 62d48e17
......@@ -1027,7 +1027,7 @@ static int
vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
char **kwlist, va_list *p_va)
{
char msgbuf[256];
char msgbuf[512];
int levels[32];
char *fname, *message;
int min, max;
......@@ -1138,7 +1138,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
if (len < min || max < len) {
if (message == NULL) {
sprintf(msgbuf,
"%s%s takes %s %d argument%s (%d given)",
"%.200s%s takes %s %d argument%s (%d given)",
fname==NULL ? "function" : fname,
fname==NULL ? "" : "()",
min==max ? "exactly"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment