chiark / gitweb /
shared, libsystemd-daemon: check for empty strings in strto*l conversions
[elogind.git] / src / libsystemd-daemon / sd-daemon.c
index 763e079b4ec0ac7cfa9bda49341e29a0672f2e87..480db3bbb9dab9eb85a8497abe1a32d97c459afe 100644 (file)
@@ -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;
         }
@@ -152,7 +152,6 @@ _sd_export_ int sd_is_fifo(int fd, const char *path) {
         if (fd < 0)
                 return -EINVAL;
 
-        memset(&st_fd, 0, sizeof(st_fd));
         if (fstat(fd, &st_fd) < 0)
                 return -errno;
 
@@ -162,7 +161,6 @@ _sd_export_ int sd_is_fifo(int fd, const char *path) {
         if (path) {
                 struct stat st_path;
 
-                memset(&st_path, 0, sizeof(st_path));
                 if (stat(path, &st_path) < 0) {
 
                         if (errno == ENOENT || errno == ENOTDIR)