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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user