diff options
| author | Guido van Rossum <guido@python.org> | 1994-11-10 22:35:48 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1994-11-10 22:35:48 +0000 |
| commit | 957ad1eef714da8c717282d077af241daeb7e745 (patch) | |
| tree | 97b33e5c1ad3fe272b1288ee8f07809fc518a7ef /Python | |
| parent | fd6dd3367f0788dc8cd0db60610e88fae20221f1 (diff) | |
| download | cpython-957ad1eef714da8c717282d077af241daeb7e745.tar.gz | |
prevent core dump for old getargs() with NULL arg
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/getargs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 605cb01957..15cd4e6ce4 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -179,6 +179,13 @@ vgetargs1(args, format, va, compat) return 0; } else if (min == 1 && max == 1) { + if (args == NULL) { + sprintf(msgbuf, + "%s requires at least one argument", + fname==NULL ? "function" : fname); + err_setstr(TypeError, msgbuf); + return 0; + } msg = convertitem(args, &format, &va, levels, msgbuf); if (msg == NULL) return 1; |
