From dc5eff9170fffae08454d56e5a71f9b6067fd79c Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sat, 27 Oct 2001 06:53:00 +0000 Subject: vgetargskeywords: Prevent another potential sprintf buffer overrun. --- Python/getargs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/getargs.c b/Python/getargs.c index 8b6b306..658d285 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -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" -- cgit v0.12