Fix more argc checks

Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
This commit is contained in:
Aditya Deshpande 2023-02-03 16:15:30 +00:00
parent 3b18a29c13
commit 9b45f6bb68
2 changed files with 2 additions and 2 deletions

View file

@ -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 <mbedtls_md> <file> <file> ...\n");

View file

@ -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;
}