Skip to content

Commit 1282423

Browse files
catenacyberjasonish
authored andcommitted
unix-socket: return after closing on too long
Avoids later use after free Ticket: 8063 (cherry picked from commit acc051a)
1 parent 5d6c24c commit 1282423

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/unix-manager.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ static void UnixCommandRun(UnixCommand * this, UnixClient *client)
554554
SCLogError("Command server: client command is too long, "
555555
"disconnect him.");
556556
UnixCommandClose(this, client->fd);
557+
return;
557558
}
558559
buffer[ret] = 0;
559560
} else {
@@ -575,6 +576,7 @@ static void UnixCommandRun(UnixCommand * this, UnixClient *client)
575576
SCLogInfo("Command server: client command is too long, "
576577
"disconnect him.");
577578
UnixCommandClose(this, client->fd);
579+
return;
578580
}
579581
if (buffer[ret - 1] == '\n') {
580582
buffer[ret-1] = 0;

0 commit comments

Comments
 (0)