mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-30 17:18:21 +03:00
daemon-stray: correct size limitation for filename
Correct the buffer size for filename printing.
This commit is contained in:
parent
b3189d9b15
commit
d194fb8513
@ -64,7 +64,7 @@ static void _daemon_get_filename(int fd, char *filename, size_t size)
|
||||
|
||||
snprintf(buf, sizeof(buf), DEFAULT_PROC_DIR "/self/fd/%u", fd);
|
||||
|
||||
if ((lsize = readlink(buf, filename, sizeof(filename) - 1)) == -1)
|
||||
if ((lsize = readlink(buf, filename, size - 1)) == -1)
|
||||
filename[0] = '\0';
|
||||
else
|
||||
filename[lsize] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user