diff options
author | Karel Zak | 2012-10-23 12:40:39 +0200 |
---|---|---|
committer | Karel Zak | 2012-10-23 12:40:39 +0200 |
commit | 9f51089e7f14f9b6f432a20ca59c0db5e5f16325 (patch) | |
tree | 85b04f0899cc474ba7ec3a97dcf620ce3f22ee63 /misc-utils/lslocks.c | |
parent | lsblk: use new sysfs functions, clean up get_transport() (diff) | |
download | kernel-qcow2-util-linux-9f51089e7f14f9b6f432a20ca59c0db5e5f16325.tar.gz kernel-qcow2-util-linux-9f51089e7f14f9b6f432a20ca59c0db5e5f16325.tar.xz kernel-qcow2-util-linux-9f51089e7f14f9b6f432a20ca59c0db5e5f16325.zip |
misc: make readlink() usage more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/lslocks.c')
-rw-r--r-- | misc-utils/lslocks.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index 820f5dcfa..33dc88750 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -196,7 +196,7 @@ static char *get_filename_sz(ino_t inode, pid_t pid, size_t *size) continue; if ((len = readlink_at(fd, path, dp->d_name, - sym, sizeof(path))) < 1) + sym, sizeof(sym) - 1)) < 1) goto out; *size = sb.st_size; |