From 5d4fe0b572c8b2c4231903d282034a668ff56baf Mon Sep 17 00:00:00 2001 From: gitlost Date: Sat, 6 Feb 2021 00:18:00 +0000 Subject: [PATCH] CLI: validate_int: just fail if length > 9 --- frontend/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/main.c b/frontend/main.c index 0f20f53d..b0484529 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -207,7 +207,7 @@ static int validate_int(const char source[], int *p_val) { int length = (int) strlen(source); if (length > 9) { /* Prevent overflow */ - length = 9; + return 0; } for (i = 0; i < length; i++) { if (source[i] < '0' || source[i] > '9') {