From 628f39bb908a032bc12ec5361723b1592022186e Mon Sep 17 00:00:00 2001 From: icy17 <1061499390@qq.com> Date: Mon, 12 Aug 2024 10:00:44 +0200 Subject: [PATCH] ws: fix potential NULL pointer dereference --- ws.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ws.c b/ws.c index 8764080e..780e8348 100644 --- a/ws.c +++ b/ws.c @@ -416,6 +416,9 @@ evws_new_session( evws->http_server = evcon->http_server; evws->bufev = evhttp_start_ws_(req); + if (evws->bufev == NULL) { + goto error; + } if (options & BEV_OPT_THREADSAFE) { if (bufferevent_enable_locking_(evws->bufev, NULL) < 0)