From: Kay Sievers Date: Tue, 1 Sep 2009 10:39:57 +0000 (+0200) Subject: libudev-util.c: get_sys_link() - return error for empty link target X-Git-Tag: 174~795 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06526049121495429757a5d2aa39189c30ca4aa7;p=systemd libudev-util.c: get_sys_link() - return error for empty link target --- diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c index 61cd9634..38cfd7d0 100644 --- a/libudev/libudev-util.c +++ b/libudev/libudev-util.c @@ -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, '/');