util-lib: reject too long path for timedate_is_valid()
This should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8827.
This commit is contained in:
@@ -1311,6 +1311,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);
|
||||
|
||||
Reference in New Issue
Block a user