aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter/scanner.l
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-12-21 21:04:56 +0000
committerGuy Harris <guy@alum.mit.edu>2003-12-21 21:04:56 +0000
commit331b8b5a8bb0343d25b49255354027e067b2c632 (patch)
treef3cdeaece926a950a00bada22283f7c6beac7db4 /epan/dfilter/scanner.l
parent8e6953dcfe8e94958d54167582bcc44ee96d4749 (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/scanner.l')
-rw-r--r--epan/dfilter/scanner.l8
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);
}