-
Notifications
You must be signed in to change notification settings - Fork 45
Fenrir fixes #255
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
Open
aidankeefe2022
wants to merge
1
commit into
wolfSSL:main
Choose a base branch
from
aidankeefe2022:fenrir-fixes-jun18-26
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fenrir fixes #255
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA | ||
| */ | ||
|
|
||
| #include "wolfclu/clu_error_codes.h" | ||
| #include <wolfclu/clu_header_main.h> | ||
| #include <wolfclu/clu_log.h> | ||
| #include <wolfclu/clu_optargs.h> | ||
|
|
@@ -202,7 +203,7 @@ int wolfCLU_dgst_setup(int argc, char** argv) | |
|
|
||
| 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-1, argv, "", | ||
| dgst_options, &longIndex )) != -1) { | ||
|
|
||
| switch (option) { | ||
|
|
@@ -273,6 +274,16 @@ int wolfCLU_dgst_setup(int argc, char** argv) | |
| } | ||
| } | ||
|
|
||
| /* Detect malformed arguments: if the trailing positional data file was | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this trying to detect? Is there a more straightforward way to err check input? |
||
| * instead consumed as the value of a required-argument option, optarg will | ||
| * string-match argv[argc-1]. The argc >= 2 guard keeps the argv[argc-2] | ||
| * access in bounds. */ | ||
| if (argc >= 2 && optarg != NULL && XSTRCMP(optarg, argv[argc-1]) == 0) { | ||
| wolfCLU_LogError("Malformed arguments last argument read as value for " | ||
| "%s", argv[argc-2]); | ||
| ret = WOLFCLU_FATAL_ERROR; | ||
| } | ||
|
Comment on lines
+281
to
+285
|
||
|
|
||
| if (ret == WOLFCLU_SUCCESS) { | ||
| if (dataBio == NULL || sigFile == NULL) { | ||
| wolfCLU_LogError("error with reading signature or data"); | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do always include it bracketed: