Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_http: fix parser memory reinitialization [2.0 backport] #7408

Merged
merged 1 commit into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/windows-setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if(FLB_WINDOWS_DEFAULTS)
set(FLB_IN_EXEC_WASI No)
set(FLB_IN_FORWARD Yes)
set(FLB_IN_HEALTH No)
set(FLB_IN_HTTP No)
set(FLB_IN_HTTP Yes)
set(FLB_IN_MEM No)
set(FLB_IN_KMSG No)
set(FLB_IN_LIB Yes)
Expand Down
4 changes: 2 additions & 2 deletions plugins/in_http/http_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static int http_conn_event(void *data)
* handled, the additional memset intends to wipe any left over data
* from the headers parsed in the previous request.
*/
memset(&conn->session.parser, 0, sizeof(mk_http_parser));
memset(&conn->session.parser, 0, sizeof(struct mk_http_parser));
mk_http_parser_init(&conn->session.parser);
http_conn_request_init(&conn->session, &conn->request);
}
Expand All @@ -146,7 +146,7 @@ static int http_conn_event(void *data)
* handled, the additional memset intends to wipe any left over data
* from the headers parsed in the previous request.
*/
memset(&conn->session.parser, 0, sizeof(mk_http_parser));
memset(&conn->session.parser, 0, sizeof(struct mk_http_parser));
mk_http_parser_init(&conn->session.parser);
http_conn_request_init(&conn->session, &conn->request);
}
Expand Down