mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-01-26 00:49:38 +07:00
libudev-util.c: get_sys_link() - return error for empty link target
This commit is contained in:
parent
32ecabb15d
commit
0652604912
@ -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, '/');
|
||||
|
Loading…
Reference in New Issue
Block a user