When parsing paths, reject anything above PATH_MAX
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user