diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2003-04-07 13:40:49 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2003-04-07 13:40:49 +0000 |
commit | 928a870349eeda544ca8e1c281f270058618150b (patch) | |
tree | 2806437c7cef81f67233d4b4dd35222095863e08 /sbin | |
parent | d7d6636d1e3666c30bfbd85a71ee3fbeb1d50934 (diff) |
Catch and refuse invalid icmp codes (> 255). ok pb@, mpech@.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/parse.y | 6 |
1 files changed, 5 insertions, 1 deletions
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); } |