Skip to content

Commit

Permalink
Fix more argc checks
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Deshpande <[email protected]>
  • Loading branch information
aditya-deshpande-arm committed Feb 3, 2023
1 parent e87ed42 commit f9ea38f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion programs/hash/generic_sum.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int main(int argc, char *argv[])

mbedtls_md_init(&md_ctx);

if (argc == 1) {
if (argc < 2) {
const int *list;

mbedtls_printf("print mode: generic_sum <mbedtls_md> <file> <file> ...\n");
Expand Down
4 changes: 3 additions & 1 deletion programs/test/query_compile_time_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@

int main(int argc, char *argv[])
{
if (argc != 2) {
int i;

if (argc < 2 || strcmp(argv[1], "-h") == 0) {
mbedtls_printf(USAGE, argv[0]);
return MBEDTLS_EXIT_FAILURE;
}
Expand Down

0 comments on commit f9ea38f

Please sign in to comment.