shared, libsystemd-daemon: check for empty strings in strto*l conversions
strtol() and friends may set EINVAL if no conversion was performed, but they are not required to do so. In practice they don't. We need to check for it. https://bugzilla.redhat.com/show_bug.cgi?id=870577
This commit is contained in:
@@ -865,7 +865,7 @@ int config_parse_mode(
|
||||
|
||||
errno = 0;
|
||||
l = strtol(rvalue, &x, 8);
|
||||
if (!x || *x || errno) {
|
||||
if (!x || x == rvalue || *x || errno) {
|
||||
log_error("[%s:%u] Failed to parse mode value, ignoring: %s", filename, line, rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user