Skip to content

F-4830 Integer Overflow#246

Open
aidankeefe2022 wants to merge 1 commit into
wolfSSL:mainfrom
aidankeefe2022:F-4830-Integer-Overflow
Open

F-4830 Integer Overflow#246
aidankeefe2022 wants to merge 1 commit into
wolfSSL:mainfrom
aidankeefe2022:F-4830-Integer-Overflow

Conversation

@aidankeefe2022

@aidankeefe2022 aidankeefe2022 commented Jun 4, 2026

Copy link
Copy Markdown
Member

changed math operation to be slower but removed chance of integer overflow

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-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.

Fenrir Automated Review — PR #246

Scan targets checked: wolfclu-bugs, wolfclu-src

No new issues found in the changed files. ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the base64 decode output-size calculation in wolfCLU_Base64Setup to avoid potential integer overflow by replacing (inputSz * 3) / 4 with an overflow-safer equivalent expression.

Changes:

  • Replaced the base64 decode output buffer size formula with an equivalent computation that avoids inputSz * 3 overflow.

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

Comment thread src/tools/clu_base64.c
/* For regular base64 decoding */
/* Calculate output size */
outputSz = (inputSz * 3) / 4 + 1;
outputSz = (inputSz / 4) * 3 + (inputSz % 4) * 3 / 4 + 1;
@aidankeefe2022 aidankeefe2022 force-pushed the F-4830-Integer-Overflow branch from 9eec52f to 711d0e3 Compare June 8, 2026 21:43
@aidankeefe2022 aidankeefe2022 changed the title changed math operation to be slower but removed chance of interger ov… F-4830 Integer Overflow Jun 8, 2026
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.

5 participants