mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-28 12:36:47 +00:00
kerndat: pass null-terminated string into strstr
Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
59bb688033
commit
281a0f9d20
1 changed files with 2 additions and 1 deletions
|
|
@ -294,11 +294,12 @@ int kerndat_fdinfo_has_lock()
|
|||
if (pfd < 0)
|
||||
goto out;
|
||||
|
||||
len = read(pfd, buf, sizeof(buf));
|
||||
len = read(pfd, buf, sizeof(buf) - 1);
|
||||
if (len < 0) {
|
||||
pr_perror("Unable to read");
|
||||
goto out;
|
||||
}
|
||||
buf[len] = 0;
|
||||
|
||||
kdat.has_fdinfo_lock = (strstr(buf, "lock:") != NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue