mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
cluster/websocket: Fix null deref at WebSocket server shutdown
WebSocket clients that connected with the wrong URL do not have a backend attached. If a dispatcher is terminated while these clients are still connected, a null deref would happen. This was found while running all cluster/websocket tests in a loop for a long time, tickling a segfault during the bad-url test.
This commit is contained in:
parent
888af244b2
commit
26441e0c24
1 changed files with 3 additions and 1 deletions
|
@ -231,7 +231,9 @@ void WebSocketEventDispatcher::Terminate() {
|
|||
wsc->getRemotePort());
|
||||
|
||||
QueueReply(WebSocketCloseReply{wsc, 1001, "Terminating"});
|
||||
backend->Terminate();
|
||||
|
||||
if ( backend )
|
||||
backend->Terminate();
|
||||
}
|
||||
|
||||
clients.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue