aboutsummaryrefslogtreecommitdiffstats
path: root/modules/websocket.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-12 10:02:15 +0000
committerGravatar Sadie Powell2026-03-12 10:02:15 +0000
commit56bda90cf63035584a95e8f619b6054076d60792 (patch)
tree924360613aa5579c47a29b36ea187103e598cc3c /modules/websocket.cpp
parentRewrite old banredirect entries to the new extban form. (diff)
Fix dereferencing a LocalUserIO that doesn't have a user yet.
Diffstat (limited to 'modules/websocket.cpp')
-rw-r--r--modules/websocket.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/websocket.cpp b/modules/websocket.cpp
index 68cf0fb09..c9d3adc3e 100644
--- a/modules/websocket.cpp
+++ b/modules/websocket.cpp
@@ -427,7 +427,10 @@ class WebSocketHook final
LocalUser* luser = nullptr;
if (sock->type == StreamSocket::SS_USER)
- luser = reinterpret_cast<LocalUserIO*>(sock)->user;
+ {
+ auto* lio = reinterpret_cast<LocalUserIO*>(sock);
+ luser = lio ? lio->user : nullptr;
+ }
bool allowedorigin = false;
HTTPHeaderFinder originheader;