diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-10-12 05:13:32 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-10-12 05:13:32 +0000 |
commit | 99e8c65674b9bed3fc6d967a9ed1dd0ca5cac374 (patch) | |
tree | 2a5f4181bd93ec9632deb9f4f2f4bb0cb402b209 /dfilter-grammar.y | |
parent | f3da72ef2fd7486be06c6bb69418d4416fdaf3e6 (diff) |
In "string_to_value()", make sure the number is valid.
svn path=/trunk/; revision=813
Diffstat (limited to 'dfilter-grammar.y')
-rw-r--r-- | dfilter-grammar.y | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dfilter-grammar.y b/dfilter-grammar.y index 9a966985d0..6d658d6520 100644 --- a/dfilter-grammar.y +++ b/dfilter-grammar.y @@ -3,7 +3,7 @@ /* dfilter-grammar.y * Parser for display filters * - * $Id: dfilter-grammar.y,v 1.26 1999/10/12 04:21:09 gram Exp $ + * $Id: dfilter-grammar.y,v 1.27 1999/10/12 05:13:32 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -810,6 +810,10 @@ string_to_value(char *s) guint32 val; val = strtoul(s, &endptr, 0); + if (endptr == s || *endptr != '\0') { + /* This isn't a valid number. */ + dfilter_fail("\"%s\" is not a valid number.", s); + } /* I should probably check errno here */ return (guint32)val; |