1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-10 05:03:02 +03:00

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 e87ed421be
commit 56d90038fd
2 changed files with 2 additions and 2 deletions

View File

@@ -173,7 +173,7 @@ int main(int argc, char *argv[])
mbedtls_md_init(&md_ctx); mbedtls_md_init(&md_ctx);
if (argc == 1) { if (argc < 2) {
const int *list; const int *list;
mbedtls_printf("print mode: generic_sum <mbedtls_md> <file> <file> ...\n"); mbedtls_printf("print mode: generic_sum <mbedtls_md> <file> <file> ...\n");

View File

@@ -38,7 +38,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
if (argc != 2) { if (argc < 2 || strcmp(argv[1], "-h") == 0) {
mbedtls_printf(USAGE, argv[0]); mbedtls_printf(USAGE, argv[0]);
return MBEDTLS_EXIT_FAILURE; return MBEDTLS_EXIT_FAILURE;
} }