[CRIU] [PATCH 6/7] show_unixsk(): avoid buffer overflow

Kir Kolyshkin kir at openvz.org
Fri Feb 10 18:30:09 EST 2012


Say in case of corrupted img file

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 sockets.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sockets.c b/sockets.c
index 47ead71..ab997a2 100644
--- a/sockets.c
+++ b/sockets.c
@@ -1175,6 +1175,7 @@ void show_unixsk(int fd)
 			ue.id, ue.peer);
 
 		if (ue.namelen) {
+			BUG_ON(ue.namelen > sizeof(buf));
 			ret = read_img_buf(fd, buf, ue.namelen);
 			if (ret < 0) {
 				pr_info("\n");
-- 
1.7.7.6



More information about the CRIU mailing list