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/libsystemd-daemon/sd-daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsystemd-daemon') diff --git a/src/libsystemd-daemon/sd-daemon.c b/src/libsystemd-daemon/sd-daemon.c index 863ac75290..480db3bbb9 100644 --- a/src/libsystemd-daemon/sd-daemon.c +++ b/src/libsystemd-daemon/sd-daemon.c @@ -88,7 +88,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) { goto finish; } - if (!p || *p || l <= 0) { + if (!p || p == e || *p || l <= 0) { r = -EINVAL; goto finish; } @@ -112,7 +112,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) { goto finish; } - if (!p || *p) { + if (!p || p == e || *p) { r = -EINVAL; goto finish; } -- cgit v1.2.3-54-g00ecf