diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2011-06-25 19:39:16 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2011-06-25 19:39:16 +0000 |
commit | a4dc6c0a7d353ed69f125f8e44becb2f3afd776b (patch) | |
tree | e0a9dc3a1d50565a59074500d807c2f206f0defc | |
parent | 1255b45566f0165f609ee898ab217eef20c023a7 (diff) | |
download | wireshark-a4dc6c0a7d353ed69f125f8e44becb2f3afd776b.tar.gz wireshark-a4dc6c0a7d353ed69f125f8e44becb2f3afd776b.tar.bz2 wireshark-a4dc6c0a7d353ed69f125f8e44becb2f3afd776b.zip |
Added check for invalid chars in abbrev in ProtoField functions.
This fixes bug 5569.
svn path=/trunk/; revision=37787
-rw-r--r-- | epan/wslua/wslua_proto.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c index a4aa2fe11a..e4f32b52d8 100644 --- a/epan/wslua/wslua_proto.c +++ b/epan/wslua/wslua_proto.c @@ -610,6 +610,11 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { /* Creates a new field to be us if (f->type == FT_NONE) WSLUA_ARG_ERROR(ProtoField_new,TYPE,"invalid FT_type"); + if (proto_check_field_name(f->abbr)) { + WSLUA_ARG_ERROR(ProtoField_new,ABBR,"Invalid char in abbrev"); + return 0; + } + if (! lua_isnil(L,WSLUA_OPTARG_ProtoField_new_VOIDSTRING) ) { if (f->type == FT_BOOLEAN) { tfs = true_false_string_from_table(L,WSLUA_OPTARG_ProtoField_new_VOIDSTRING); @@ -664,6 +669,11 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) { return 0; } + if (proto_check_field_name(abbr)) { + luaL_argerror(L, 1, "Invalid char in abbrev"); + return 0; + } + f->hfid = -2; f->ett = -1; f->name = g_strdup(name); @@ -816,6 +826,11 @@ static int ProtoField_boolean(lua_State* L, enum ftenum type) { return 0; } + if (proto_check_field_name(abbr)) { + luaL_argerror(L,1,"Invalid char in abbrev"); + return 0; + } + f->hfid = -2; f->ett = -1; f->name = g_strdup(name); @@ -854,6 +869,11 @@ static int ProtoField_other(lua_State* L,enum ftenum type) { const gchar* name = luaL_optstring(L,2,abbr); const gchar* blob = luaL_optstring(L,3,NULL); + if (proto_check_field_name(abbr)) { + luaL_argerror(L,1,"Invalid char in abbrev"); + return 0; + } + f->hfid = -2; f->ett = -1; f->name = g_strdup(name); |