projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b674e2
)
When parsing paths, reject anything above PATH_MAX
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Fri, 7 Dec 2018 15:12:19 +0000
(16:12 +0100)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 10 Dec 2018 10:57:26 +0000
(11:57 +0100)
The check for length is done after path_simplify(), to be nice to paths which
are constructed using specifiers, and have duplicate slashes and stuff.
src/basic/path-util.c
patch
|
blob
|
history
diff --git
a/src/basic/path-util.c
b/src/basic/path-util.c
index
995f39f
..
2215173
100644
(file)
--- a/
src/basic/path-util.c
+++ b/
src/basic/path-util.c
@@
-1139,5
+1139,12
@@
int path_simplify_and_warn(
return -EINVAL;
}
+ if (!path_is_valid(path)) {
+ log_syntax(unit, LOG_ERR, filename, line, 0,
+ "%s= path has invalid length (%zu bytes)%s.",
+ lvalue, strlen(path), fatal ? "" : ", ignoring");
+ return -EINVAL;
+ }
+
return 0;
}