Skip to content

Commit 0c697df

Browse files
committed
Add defense code
1 parent 7fe4187 commit 0c697df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext-src/swoole_http_request.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ static int http_request_on_header_value(swoole_http_parser *parser, const char *
380380
goto _add_header;
381381
}
382382
Server *serv = (Server *) ctx->private_data;
383+
if (!serv) {
384+
goto _add_header;
385+
}
383386
Connection *conn = serv->get_connection_by_session_id(ctx->fd);
384387
if (!conn) {
385388
swoole_error_log(SW_LOG_NOTICE, SW_ERROR_SESSION_CLOSED, "session[%ld] is closed", ctx->fd);

0 commit comments

Comments
 (0)