From c4c748a46516f34de7c94774388a4ffbbf7421da Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Thu, 19 Dec 2024 08:45:44 +0200 Subject: [PATCH] tncattach - Only allow prefix length of between 0 to 128 --- tncattach.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tncattach.c b/tncattach.c index 04041eb..802ff74 100644 --- a/tncattach.c +++ b/tncattach.c @@ -508,6 +508,11 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { printf("Prefix length '%s' is not numeric\n", prefixPart_s); exit(EXIT_FAILURE); } + else if(!(prefixLen_l >= 0 && prefixLen_l <= 128)) + { + printf("Prefix length '%s' is not within valid range of 0-128\n", prefixPart_s); + exit(EXIT_FAILURE); + } arguments->ipv6 = ipPart_s;