Skip to content

fix: prevent segfault on OPTIONS preflight requests - #539

Open
thunderbug1 wants to merge 1 commit into
ROCm:mainfrom
thunderbug1:fix/options-preflight-crash
Open

fix: prevent segfault on OPTIONS preflight requests#539
thunderbug1 wants to merge 1 commit into
ROCm:mainfrom
thunderbug1:fix/options-preflight-crash

Conversation

@thunderbug1

Copy link
Copy Markdown

Summary

  • Fixes a SIGSEGV crash in boost::beast::buffers_suffix::consume() when handling CORS preflight (OPTIONS) requests
  • Changed http::response<http::empty_body> to http::response<http::string_body> with an empty body, which correctly sets Content-Length: 0 instead of falling back to chunked transfer encoding

Closes #379

Tested on: Linux 7.0.0-14-generic (Ubuntu), AMD Ryzen AI 9 HX 370 w/ Radeon 890M

Using http::empty_body with prepare_payload() causes Boost.Beast to
use chunked transfer encoding for keep-alive connections, but the
empty_body serializer cannot produce valid chunked buffers. Switch to
http::string_body with an empty body, which correctly sets
Content-Length: 0 instead.

Tested on: Linux 7.0.0-14-generic (Ubuntu), AMD Ryzen AI 9 HX 370 w/ Radeon 890M

Closes ROCm#379
@thunderbug1

Copy link
Copy Markdown
Author

For me this is the missing bugfix why I cannot use the main branch, can we merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flm serve crash on linux

1 participant