diff options
| author | 2026-03-12 10:02:15 +0000 | |
|---|---|---|
| committer | 2026-03-12 10:02:15 +0000 | |
| commit | 56bda90cf63035584a95e8f619b6054076d60792 (patch) | |
| tree | 924360613aa5579c47a29b36ea187103e598cc3c /modules/websocket.cpp | |
| parent | Rewrite 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.cpp | 5 |
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; |
