You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 18, 2025. It is now read-only.
I've encountered a seg fault after registering a new uri. The issue seems to related to memcpy of response_string. I think the 3rd argument should be the size of the response string to be copied instead of kMaxBufferSize, or whichever is smaller.
Hi, thank you for the great work.
I've encountered a seg fault after registering a new uri. The issue seems to related to
memcpyofresponse_string. I think the 3rd argument should be the size of the response string to be copied instead ofkMaxBufferSize, or whichever is smaller.http-server/src/http_server.cc
Lines 238 to 242 in 1c17136
this is a potential fix.
response_string = to_string (http_response, http_request.method () != HttpMethod::HEAD); const size_t res_len = response_string.length (); size_t len_to_copy = (res_len < kMaxBufferSize) ? res_len : kMaxBufferSize; memmove (raw_response->buffer, response_string.c_str (), len_to_copy); raw_response->buffer[response_string.length ()] = '\0'; raw_response->length = response_string.length ();I've forked the project to reproduce my error at this repo.