From 928a870349eeda544ca8e1c281f270058618150b Mon Sep 17 00:00:00 2001 From: Daniel Hartmeier Date: Mon, 7 Apr 2003 13:40:49 +0000 Subject: Catch and refuse invalid icmp codes (> 255). ok pb@, mpech@. --- sbin/pfctl/parse.y | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 97dafa447f1..08852dd5246 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.352 2003/04/05 23:56:32 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.353 2003/04/07 13:40:48 dhartmei Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -3997,5 +3997,9 @@ parseicmpspec(char *w, sa_family_t af) } ulval = p->code; } + if (ulval > 255) { + yyerror("invalid icmp code %ld", ulval); + return (0); + } return (icmptype << 8 | ulval); } -- cgit v1.2.3