Skip to content

F-4985 Integer Overflow#235

Merged
cconlon merged 1 commit into
wolfSSL:mainfrom
stenslae:4985-integer-overflow
May 29, 2026
Merged

F-4985 Integer Overflow#235
cconlon merged 1 commit into
wolfSSL:mainfrom
stenslae:4985-integer-overflow

Conversation

@stenslae
Copy link
Copy Markdown
Member

Added bounds checking in wolfCLU_HttpServerRecv().

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds bounds checking in wolfCLU_HttpServerRecv() to prevent integer overflow when comparing totalLen against headerSz + contentLen, and clamps contentLen to the available buffer space. Callers are expected to re-validate the received body length against the advertised Content-Length.

Changes:

  • Clamp contentLen so it cannot exceed remaining buffer capacity (bufferSz - 1 - headerSz).
  • Reformulate the "full body received" check as totalLen - headerSz >= contentLen to avoid potential overflow in headerSz + contentLen.
  • Update doc comment to describe the clamping behavior and caller responsibility.

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

Comment thread src/tools/clu_http.c Outdated
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #235

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

@stenslae stenslae force-pushed the 4985-integer-overflow branch from 2bac6b6 to ca94898 Compare May 28, 2026 22:40
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #235

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

@stenslae stenslae assigned cconlon and unassigned stenslae May 29, 2026
@cconlon cconlon merged commit e3d8ab6 into wolfSSL:main May 29, 2026
27 checks passed
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.

4 participants