chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
32ecabb
)
libudev-util.c: get_sys_link() - return error for empty link target
author
Kay Sievers
<kay.sievers@vrfy.org>
Tue, 1 Sep 2009 10:39:57 +0000
(12:39 +0200)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Tue, 1 Sep 2009 10:39:57 +0000
(12:39 +0200)
libudev/libudev-util.c
patch
|
blob
|
history
diff --git
a/libudev/libudev-util.c
b/libudev/libudev-util.c
index 61cd963421a4842db897318b0aa83537ef29aac5..38cfd7d0e6ffc656ab34b466bf32f3d25442ca30 100644
(file)
--- 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));
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, '/');
return -1;
path[len] = '\0';
pos = strrchr(path, '/');