Skip to content

Removed double free - #281

Open
aidankeefe2022 wants to merge 1 commit into
wolfSSL:mainfrom
aidankeefe2022:fenrir-8060
Open

Removed double free#281
aidankeefe2022 wants to merge 1 commit into
wolfSSL:mainfrom
aidankeefe2022:fenrir-8060

Conversation

@aidankeefe2022

Copy link
Copy Markdown
Member

https://fenrir.wolfssl.com/finding/8060

Removed needless free and now all logic will all fall to common clean up at end of setup function.

@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 #281

Scan targets checked: wolfclu-bugs, wolfclu-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/tools/clu_base64.c
opterr = 0; /* do not display unrecognized options */
optind = 0; /* start at indent 0 */
while ((option = wolfCLU_GetOpt(argc, argv, "",
while (ret == WOLFCLU_SUCCESS && (option = wolfCLU_GetOpt(argc, argv, "",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ [Info] New loop guard suppresses -help output when an earlier option handler fails · Logic errors

wolfCLU_GetOpt scans base64_options[] in table order, so -in/-out are always handled before WOLFCLU_HELP regardless of argv position. With the added ret == WOLFCLU_SUCCESS guard, wolfssl base64 -help -in /nonexistent now returns -1 without printing help; previously help was printed.

Related known finding #8060 (similar but distinct): Both affect wolfCLU_Base64Setup and table-ordered option processing, but this concerns the new ret loop guard preventing help output after an earlier failure; #8060 frees bioIn twice after an output-file-open failure. Their faulting operations, root causes, and required patches differ.

Fix: If -help should take precedence, check for the help flag before the option loop rather than relying on table-order parsing.

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