chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec4b18d
)
util-lib: reject too long path for timedate_is_valid()
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 11 Jun 2018 03:31:02 +0000
(12:31 +0900)
committer
Sven Eden
<yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000
(16:47 +0200)
This should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8827.
src/basic/time-util.c
patch
|
blob
|
history
diff --git
a/src/basic/time-util.c
b/src/basic/time-util.c
index 71d6179efacd8156f397b29138452a59125b30ec..2e465296fca739645a9c2ed017e0e89cc2639146 100644
(file)
--- a/
src/basic/time-util.c
+++ b/
src/basic/time-util.c
@@
-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);