]> granicus.if.org Git - python/commitdiff
Protect PyErr_Format format string argument from overflow (ironically,
authorGuido van Rossum <guido@python.org>
Mon, 19 Jan 1998 22:22:44 +0000 (22:22 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 19 Jan 1998 22:22:44 +0000 (22:22 +0000)
the error was about a bad format string :-).

Python/getargs.c

index 296a3aa2c7ccad815b05ab95f933d4897f22d2f3..7bc150d1e470c5e45bb63e31e42ee92c575bded3 100644 (file)
@@ -261,7 +261,7 @@ vgetargs1(args, format, p_va, compat)
            *format != '(' &&
            *format != '|' && *format != ':' && *format != ';') {
                PyErr_Format(PyExc_SystemError,
-                            "bad format string: %s", formatsave);
+                            "bad format string: %.200s", formatsave);
                return 0;
        }