diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-04-21 14:44:33 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2010-04-21 14:44:33 +0200 |
commit | 60067cc75ac7dd583beea584f87f2f6d3358f3c1 (patch) | |
tree | 79e2b1cc2ebc5d2f7a8c6b99a3b75cf72a4e3719 /udev/udev-watch.c | |
parent | e925018786d85fb3aed3b62a0a89309f9a7d5e4f (diff) |
more readlink buffer size handling
Diffstat (limited to 'udev/udev-watch.c')
-rw-r--r-- | udev/udev-watch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/udev/udev-watch.c b/udev/udev-watch.c index 7135d9f472..5fa60101c4 100644 --- a/udev/udev-watch.c +++ b/udev/udev-watch.c @@ -81,7 +81,7 @@ void udev_watch_restore(struct udev *udev) s = device; l = util_strpcpy(&s, sizeof(device), udev_get_sys_path(udev)); len = readlinkat(dirfd(dir), ent->d_name, s, l); - if (len <= 0 || len >= (ssize_t)l) + if (len <= 0 || len == (ssize_t)l) goto unlink; s[len] = '\0'; @@ -173,7 +173,7 @@ struct udev_device *udev_watch_lookup(struct udev *udev, int wd) s = majmin; l = util_strpcpy(&s, sizeof(majmin), udev_get_sys_path(udev)); len = readlink(filename, s, l); - if (len < 0 || (size_t)len >= l) + if (len <= 0 || (size_t)len == l) return NULL; s[len] = '\0'; |