From acc051ac943759fbb7ba68320844eda3e96c60a4 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 30 Oct 2025 22:08:28 +0100 Subject: [PATCH] unix-socket: return after closing on too long Avoids later use after free Ticket: 8063 --- src/unix-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix-manager.c b/src/unix-manager.c index 3d8d120bd3..c058b7c441 100644 --- a/src/unix-manager.c +++ b/src/unix-manager.c @@ -554,6 +554,7 @@ static void UnixCommandRun(UnixCommand * this, UnixClient *client) SCLogError("Command server: client command is too long, " "disconnect him."); UnixCommandClose(this, client->fd); + return; } buffer[ret] = 0; } else { @@ -575,6 +576,7 @@ static void UnixCommandRun(UnixCommand * this, UnixClient *client) SCLogInfo("Command server: client command is too long, " "disconnect him."); UnixCommandClose(this, client->fd); + return; } if (buffer[ret - 1] == '\n') { buffer[ret-1] = 0;