tncattach

- Only allow prefix length of between 0 to 128
This commit is contained in:
Tristan B. Velloza Kildaire 2024-12-19 08:45:44 +02:00
parent 6830ddad67
commit c4c748a465

View File

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