From f3910003bce32ebdc1dbb71fd9ca2d4b8352b563 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Tue, 30 Oct 2012 10:29:40 +0100 Subject: 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 --- src/shared/conf-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/conf-parser.c') diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 4bf3147f2d..9f5c07c761 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -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; } -- cgit v1.2.3-54-g00ecf