]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
config: add more null path checks
authorJaroslav Kysela <perex@perex.cz>
Sun, 3 May 2015 17:57:51 +0000 (19:57 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 3 May 2015 17:57:51 +0000 (19:57 +0200)
src/config.c

index a56ca7c4da6f54cbd6d4e7b278b5344848e5dcdc..34bb15dfe6f26465a44621fd2ca12aec00a4a7e6 100644 (file)
@@ -1203,6 +1203,8 @@ dobackup(const char *oldver)
   pid_t pid;
   int code;
 
+  assert(root);
+
   tvhinfo("config", "backup: migrating config from %s (running %s)",
                     oldver, tvheadend_version);
 
@@ -1448,7 +1450,7 @@ config_init ( int backup )
 {
   const char *path = hts_settings_get_root();
 
-  if (access(path, R_OK | W_OK)) {
+  if (path == NULL || access(path, R_OK | W_OK)) {
     tvhwarn("START", "configuration path %s is not r/w"
                      " for UID:%d GID:%d [e=%s],"
                      " settings will not be saved",