Commit 41fb6b3f authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Cyrill Gorcunov

show_unixsk(): avoid buffer overflow

Say in case of corrupted img file
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent bf1ca46d
...@@ -1175,6 +1175,7 @@ void show_unixsk(int fd) ...@@ -1175,6 +1175,7 @@ void show_unixsk(int fd)
ue.id, ue.peer); ue.id, ue.peer);
if (ue.namelen) { if (ue.namelen) {
BUG_ON(ue.namelen > sizeof(buf));
ret = read_img_buf(fd, buf, ue.namelen); ret = read_img_buf(fd, buf, ue.namelen);
if (ret < 0) { if (ret < 0) {
pr_info("\n"); pr_info("\n");
......
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