From c2e6cf12b8b84d4b356ddcfa38e6c90fdd778ae2 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 15 Nov 2014 16:26:02 +0100 Subject: [PATCH] Bail out on empty CCACHE_DIR --- ccache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ccache.c b/ccache.c index d315b0bea..0f356c0ab 100644 --- 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); } -- 2.47.2