Code

Fix serious bug where a stack allocated variable was returned
[tig.git] / 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
        };