Skip to content

sws: fix potential OOB write - #20988

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:swsoob
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:swsoob

Conversation

@vszakats

Copy link
Copy Markdown
Member

Found by Codex Security

Follow-up to 0aaebf6

Found by Codex Security

Follow-up to 0aaebf6

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a potential out-of-bounds write in the sws test server by ensuring reads into the request buffer always leave room for a NUL terminator when logging/storing received websocket traffic.

Changes:

  • Adjusted websocket traffic sread() length calculation to reserve 1 byte for '\0'.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@vszakats

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Mar 18, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Fixes a potential out-of-bounds write in the sws test server when reading upgraded (websocket) traffic into the request buffer.

Changes:

  • Adjusts the `sread()` length calculation to leave space for a terminating NUL byte before later writing `reqbuf[req->offset] = '\0'`

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@vszakats vszakats closed this in 2bb3643 Mar 19, 2026
@vszakats
vszakats deleted the swsoob branch March 19, 2026 11:06
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Found by Codex Security

Follow-up to 0aaebf6

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

Development

Successfully merging this pull request may close these issues.

2 participants