32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
From a8f7ea10802f6363146e11e2552177bc1e5a6e12 Mon Sep 17 00:00:00 2001
|
|
From: Glenn Strauss <gstrauss@gluelogic.com>
|
|
Date: Tue, 13 Sep 2022 05:51:02 +0000
|
|
Subject: [PATCH] [mod_wstunnel] fix crash with bad hybivers (fixes #3165)
|
|
|
|
x-ref:
|
|
"mod_wstunnel null pointer dereference"
|
|
https://redmine.lighttpd.net/issues/3165
|
|
---
|
|
src/mod_wstunnel.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/mod_wstunnel.c b/src/mod_wstunnel.c
|
|
index 6d17d4d..97b89f0 100644
|
|
--- a/src/mod_wstunnel.c
|
|
+++ b/src/mod_wstunnel.c
|
|
@@ -483,7 +483,10 @@ static handler_t wstunnel_handler_setup (request_st * const r, plugin_data * con
|
|
hctx->errh = r->conf.errh;/*(for mod_wstunnel-specific DEBUG_* macros)*/
|
|
hctx->conf = p->conf; /*(copies struct)*/
|
|
hybivers = wstunnel_check_request(r, hctx);
|
|
- if (hybivers < 0) return HANDLER_FINISHED;
|
|
+ if (hybivers < 0) {
|
|
+ r->handler_module = NULL;
|
|
+ return HANDLER_FINISHED;
|
|
+ }
|
|
hctx->hybivers = hybivers;
|
|
if (0 == hybivers) {
|
|
DEBUG_LOG_INFO("WebSocket Version = %s", "hybi-00");
|
|
--
|
|
2.33.0
|
|
|