From 5fe850f1c1b2f7c7384f2784d5acd9154f4252b4 Mon Sep 17 00:00:00 2001 From: liqiang Date: Fri, 26 May 2023 10:18:35 +0800 Subject: [PATCH] fix a msglen invalid problem Signed-off-by: liqiang --- qtfs/ipc/uds_event.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qtfs/ipc/uds_event.c b/qtfs/ipc/uds_event.c index 2113185..b046b69 100644 --- a/qtfs/ipc/uds_event.c +++ b/qtfs/ipc/uds_event.c @@ -944,6 +944,10 @@ int uds_event_tcp2uds(void *arg, int epfd, struct uds_event_global_var *p_event_ int len; int scmfd; struct uds_msg_scmrights *p_scm = (struct uds_msg_scmrights *) p_msg->data; + if (p_msg->msglen >= sizeof(p_scm->path)) { + uds_err("recv msg len invalid:%d", p_msg->msglen); + goto err; + } memset(p_scm->path, 0, sizeof(p_scm->path)); // SCM RIGHTS msg proc len = recv(evt->fd, p_msg->data, p_msg->msglen, MSG_WAITALL); -- Gitee