From d351a2403c5946d07ae6e6b6e075ff9896c6bcb6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 12 Aug 2013 18:05:27 +0200 Subject: Improve integer checks --- src/config.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/config.y') diff --git a/src/config.y b/src/config.y index deaa100..55d0e94 100644 --- a/src/config.y +++ b/src/config.y @@ -311,7 +311,7 @@ bind_default: ; mtu: TOK_UINT { - if ($1 > 65535) { + if (conf->mtu < 576 || $1 > 65535) { fastd_config_error(&@$, ctx, conf, filename, depth, "invalid MTU"); YYERROR; } @@ -544,7 +544,7 @@ colon_or_port: ':' ; port: colon_or_port TOK_UINT { - if ($2 > 65535) { + if ($2 < 1 || $2 > 65535) { fastd_config_error(&@$, ctx, conf, filename, depth, "invalid port"); YYERROR; } -- cgit v1.2.3