summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-10-27 06:53:00 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-10-27 06:53:00 (GMT)
commitdc5eff9170fffae08454d56e5a71f9b6067fd79c (patch)
tree1b32cabb9f115ec2dc48b677f5c3c0a17f6d09c9 /Python
parent62d48e1735db7acdbacbe7eec0131dd79f529a18 (diff)
downloadcpython-dc5eff9170fffae08454d56e5a71f9b6067fd79c.zip
cpython-dc5eff9170fffae08454d56e5a71f9b6067fd79c.tar.gz
cpython-dc5eff9170fffae08454d56e5a71f9b6067fd79c.tar.bz2
vgetargskeywords: Prevent another potential sprintf buffer overrun.
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c4
1 files 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"