]> err.no Git - systemd/commitdiff
libudev-util.c: get_sys_link() - return error for empty link target
authorKay Sievers <kay.sievers@vrfy.org>
Tue, 1 Sep 2009 10:39:57 +0000 (12:39 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 1 Sep 2009 10:39:57 +0000 (12:39 +0200)
libudev/libudev-util.c

index 61cd963421a4842db897318b0aa83537ef29aac5..38cfd7d0e6ffc656ab34b466bf32f3d25442ca30 100644 (file)
@@ -31,7 +31,7 @@ static ssize_t get_sys_link(struct udev *udev, const char *slink, const char *sy
 
        util_strscpyl(path, sizeof(path), syspath, "/", slink, NULL);
        len = readlink(path, path, sizeof(path));
-       if (len < 0 || len >= (ssize_t) sizeof(path))
+       if (len <= 0 || len == (ssize_t)sizeof(path))
                return -1;
        path[len] = '\0';
        pos = strrchr(path, '/');