Commit 281a0f9d authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

kerndat: pass null-terminated string into strstr

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 59bb6880
...@@ -294,11 +294,12 @@ int kerndat_fdinfo_has_lock() ...@@ -294,11 +294,12 @@ int kerndat_fdinfo_has_lock()
if (pfd < 0) if (pfd < 0)
goto out; goto out;
len = read(pfd, buf, sizeof(buf)); len = read(pfd, buf, sizeof(buf) - 1);
if (len < 0) { if (len < 0) {
pr_perror("Unable to read"); pr_perror("Unable to read");
goto out; goto out;
} }
buf[len] = 0;
kdat.has_fdinfo_lock = (strstr(buf, "lock:") != NULL); kdat.has_fdinfo_lock = (strstr(buf, "lock:") != NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment