diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-05-18 15:33:07 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-05-18 15:33:07 +0000 |
commit | fcac4a1d7d52289e4b306ebd2de47c68bdbe3fbf (patch) | |
tree | 4b767ef8297c4b8066a825e56e607c2ce6c4d79e /epan/wslua | |
parent | 5921cd68a219feca2b9bca825196181842f5cf36 (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5930 :
with a variant of the patch submitted by Alexander Stein on the -dev list:
Allow FT_FRAMENUMs to be added (as base BASE_NONE). My change from Alexander's
patch is to disallow BASE_NONE for non-framenum integers.
svn path=/trunk/; revision=37239
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_proto.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c index db4b5da3b6..d9b90ec805 100644 --- a/epan/wslua/wslua_proto.c +++ b/epan/wslua/wslua_proto.c @@ -656,8 +656,11 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) { int mask = luaL_optint(L, 5, 0x0); const gchar* blob = luaL_optstring(L,6,NULL); - if (base < BASE_DEC || base > BASE_HEX_DEC) { - luaL_argerror(L,2,"Base must be either BASE_DEC, BASE_HEX, BASE_OCT," + if (type == FT_FRAMENUM) { + if (base != BASE_NONE) + luaL_argerror(L, 3, "FT_FRAMENUMs must use BASE_NONE"); + } else if (base < BASE_DEC || base > BASE_HEX_DEC) { + luaL_argerror(L, 3, "Base must be either BASE_DEC, BASE_HEX, BASE_OCT," " BASE_DEC_HEX, BASE_DEC_HEX or BASE_HEX_DEC"); return 0; } |