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

fixed 3rd argument in memcpy (w/ null terminator) #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikeliaohm
Copy link

  • Fix 3rd argument in memcpy to only copy the response string length or up to kMaxBufferSize.
  • Make sure raw_response->buffer is always null terminated.

@trungams
Copy link
Owner

trungams commented Mar 8, 2023

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.

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.

2 participants