http-server
http-server copied to clipboard
fixed 3rd argument in memcpy (w/ null terminator)
- Fix 3rd argument in memcpy to only copy the response string length or up to
kMaxBufferSize. - Make sure
raw_response->bufferis always null terminated.
Thank you for making this PR. The first change to fix memcpy's issue is good, but the second change about null termination makes me realize that a server's response could be truncated by this implementation of a fixed buffer, which is an unwanted behaviour. It's been a while since I wrote this code and I may have forgotten a few things about the requirements for an HTTP server. I'll do some research and get back to you on the change.