diff --git a/irqbalance.c b/irqbalance.c index 6422a7b..f80244c 100644 --- a/irqbalance.c +++ b/irqbalance.c @@ -400,12 +400,12 @@ void get_object_stat(struct topo_obj *object, void *data) #ifdef HAVE_IRQBALANCEUI gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attribute__((unused))) { - char buff[500]; + char buff[16384]; int sock; int recv_size = 0; int valid_user = 0; - struct iovec iov = { buff, 500 }; + struct iovec iov = { buff, sizeof(buff) }; struct msghdr msg = { .msg_iov = &iov, .msg_iovlen = 1, @@ -426,6 +426,10 @@ gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attri log(TO_ALL, LOG_WARNING, "Error while receiving data.\n"); goto out_close; } + if (recv_size == sizeof(buff)) { + log(TO_ALL, LOG_WARNING, "Received command too long.\n"); + goto out_close; + } cmsg = CMSG_FIRSTHDR(&msg); if (!cmsg) { log(TO_ALL, LOG_WARNING, "Connection no memory.\n");