diff --git a/programs/hash/generic_sum.c b/programs/hash/generic_sum.c index e2e49e343..995694af0 100644 --- a/programs/hash/generic_sum.c +++ b/programs/hash/generic_sum.c @@ -169,7 +169,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 ...\n"); diff --git a/programs/test/query_compile_time_config.c b/programs/test/query_compile_time_config.c index 8f763facd..df0fe4a70 100644 --- a/programs/test/query_compile_time_config.c +++ b/programs/test/query_compile_time_config.c @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) { int i; - if (argc == 1 || strcmp(argv[1], "-h") == 0) { + if (argc < 2 || strcmp(argv[1], "-h") == 0) { mbedtls_printf(USAGE, argv[0]); return MBEDTLS_EXIT_FAILURE; }