]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Bail out on empty CCACHE_DIR
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 15 Nov 2014 15:26:02 +0000 (16:26 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 15 Nov 2014 15:26:02 +0000 (16:26 +0100)
ccache.c

index d315b0beaf949fad7b8910e6d719b15f07e53b61..0f356c0ab3f3c4964e5ac40866bac9711e76ca78 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -2449,10 +2449,16 @@ initialize(void)
                        free(errmsg);
                }
 
+               if (str_eq(conf->cache_dir, "")) {
+                       fatal("configuration setting \"cache_dir\" must not be the empty string");
+               }
                if ((p = getenv("CCACHE_DIR"))) {
                        free(conf->cache_dir);
                        conf->cache_dir = strdup(p);
                }
+               if (str_eq(conf->cache_dir, "")) {
+                       fatal("CCACHE_DIR must not be the empty string");
+               }
 
                primary_config_path = format("%s/ccache.conf", conf->cache_dir);
        }