From: Dmitry V. Levin Date: Sat, 23 Jan 2016 22:46:40 +0000 (+0300) Subject: unix_parse_response: add a safety check X-Git-Tag: v4.12~613 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d0f55e41908a489f3d7e0cbe2c0d20de7e131c0;p=strace unix_parse_response: add a safety check * socketutils.c (unix_parse_response): Check that netlink message is large enough to contain a unix_diag_msg structure. --- diff --git a/socketutils.c b/socketutils.c index 2f4a9b03..67fc1ee7 100644 --- a/socketutils.c +++ b/socketutils.c @@ -245,6 +245,8 @@ unix_parse_response(const char *proto_name, const void *data, int data_len, size_t path_len = 0; char path[UNIX_PATH_MAX + 1]; + if (rta_len < 0) + return false; if (diag_msg->udiag_ino != inode) return false; if (diag_msg->udiag_family != AF_UNIX)