summaryrefslogtreecommitdiff
path: root/libudev/libudev-util.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-09-01 12:39:57 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-09-01 12:39:57 +0200
commit06526049121495429757a5d2aa39189c30ca4aa7 (patch)
tree10d58a7ad122f86f9eac10bdeb371e193730c837 /libudev/libudev-util.c
parent32ecabb15d76bd9db8f7d15dcd39807383a93934 (diff)
libudev-util.c: get_sys_link() - return error for empty link target
Diffstat (limited to 'libudev/libudev-util.c')
-rw-r--r--libudev/libudev-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c
index 61cd963421..38cfd7d0e6 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, '/');