Code

Fix serious bug where a stack allocated variable was returned
authorJonas Fonseca <fonseca@diku.dk>
Sat, 17 Jan 2009 18:57:10 +0000 (19:57 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Sat, 17 Jan 2009 22:14:08 +0000 (23:14 +0100)
Reproducable when calling tig with log arguments.

tig.c

diff --git a/tig.c b/tig.c
index d812fa395cd8b13487099ec0667ad4e192f008f1..08f080a09beb51cc33b0c63c0856ace1527586cf 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -797,7 +797,7 @@ parse_options(int argc, const char *argv[], const char ***run_argv)
        bool seen_dashdash = FALSE;
        /* XXX: This is vulnerable to the user overriding options
         * required for the main view parser. */
-       const char *custom_argv[SIZEOF_ARG] = {
+       static const char *custom_argv[SIZEOF_ARG] = {
                "git", "log", "--no-color", "--pretty=raw", "--parents",
                        "--topo-order", NULL
        };