Skip to content

Update IXWebSocketHttpHeaders.cpp#564

Open
zjp8369 wants to merge 1 commit intomachinezone:masterfrom
zjp8369:master
Open

Update IXWebSocketHttpHeaders.cpp#564
zjp8369 wants to merge 1 commit intomachinezone:masterfrom
zjp8369:master

Conversation

@zjp8369
Copy link
Copy Markdown

@zjp8369 zjp8369 commented Jan 6, 2026

修改header中值为空时,程序崩溃问题

修改header中值为空时,程序崩溃问题
@bsergean
Copy link
Copy Markdown
Collaborator

bsergean commented May 1, 2026

Thanks for identifying this bug! I've opened #574 as an alternative fix that addresses the same root cause with a few improvements:

  • Adds the missing bounds check on the space-skipping while loop (UB if colon is at the end of the line)
  • Replaces the size - start - 2 unsigned arithmetic with a trailing trim — avoids size_t underflow and handles both \r\n and \n-only line endings
  • Fixes the isspace UB by casting to unsigned char in the lambda
  • Removes the redundant 1024-byte cap (the buffer is already capped at 1023 chars)

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