chiark / gitweb /
util-lib: reject too long path for timedate_is_valid()
[elogind.git] / src / basic / time-util.c
index 71d6179efacd8156f397b29138452a59125b30ec..2e465296fca739645a9c2ed017e0e89cc2639146 100644 (file)
@@ -1326,6 +1326,9 @@ bool timezone_is_valid(const char *name, int log_level) {
         if (slash)
                 return false;
 
+        if (p - name >= PATH_MAX)
+                return false;
+
         t = strjoina("/usr/share/zoneinfo/", name);
 
         fd = open(t, O_RDONLY|O_CLOEXEC);