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

20241221-fix-CEscape-bounds-check #8309

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

douzzer
Copy link
Contributor

@douzzer douzzer commented Dec 21, 2024

wolfcrypt/src/coding.c: fix incorrect array bounds check in CEscape(), introduced in 8bbe8a7 (before which there was no bounds check at all).

…, introduced in 8bbe8a7 (before which there was no bounds check at all).
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

wolfcrypt/src/coding.c:301:29: warning: Either the condition 'e<=sizeof(base64Encode)' is redundant or the array 'base64Encode[64]' is accessed at index 64, which is out of bounds. [arrayIndexOutOfBoundsCond]
        basic = base64Encode[e];
                            ^
8bbe8a7c8a (<[[email protected]](mailto:[email protected])> 2024-12-19 17:01:25 -0700 300)     else if (e <= sizeof(base64Encode))
wolfcrypt/src/coding.c:300:16: note: Assuming that condition 'e<=sizeof(base64Encode)' is not redundant
    else if (e <= sizeof(base64Encode))
               ^
a5529b124d (<[[email protected]](mailto:[email protected])> 2014-12-19 09:56:51 -0700 301)         basic = base64Encode[e];
wolfcrypt/src/coding.c:301:29: note: Array index out of bounds
        basic = base64Encode[e];
                            ^
    cppcheck real elapsed 2912s
    cppcheck-force-source fail_analysis```

@dgarske dgarske merged commit 2bcad98 into wolfSSL:master Dec 21, 2024
149 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants