diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-12-21 21:04:56 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-12-21 21:04:56 +0000 |
commit | 331b8b5a8bb0343d25b49255354027e067b2c632 (patch) | |
tree | f3cdeaece926a950a00bada22283f7c6beac7db4 /epan/dfilter | |
parent | 8e6953dcfe8e94958d54167582bcc44ee96d4749 (diff) |
Add, for \xXX, the same sanity check (that 0xXX fits in a single byte)
that we have for \0OOO.
svn path=/trunk/; revision=9396
Diffstat (limited to 'epan/dfilter')
-rw-r--r-- | epan/dfilter/scanner.l | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l index 6d473c1822..4798b2b386 100644 --- a/epan/dfilter/scanner.l +++ b/epan/dfilter/scanner.l @@ -1,6 +1,6 @@ %{ /* - * $Id: scanner.l,v 1.12 2003/12/20 23:50:50 ulfl Exp $ + * $Id: scanner.l,v 1.13 2003/12/21 21:04:56 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -161,6 +161,12 @@ GString* quoted_string = NULL; /* hex sequence */ unsigned int result; sscanf(yytext + 2, "%x", &result); + if (result > 0xff) { + g_string_free(quoted_string, TRUE); + quoted_string = NULL; + dfilter_fail("%s is larger than 255.", yytext); + return SCAN_FAILED; + } g_string_append_c(quoted_string, (gchar) result); } |