diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-14 22:15:21 +0100 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-14 21:22:51 +0000 |
commit | 13101020e12eb21e8464a3c4eb4fc2fe51409235 (patch) | |
tree | c2b5c48b07181835d156efdb5ccff743f8468aad /epan/wslua/wslua_tree.c | |
parent | 9196fa96edc467b04b68e845eb735c97ed3c8d3a (diff) |
Lua: Disallow ProtoField FRAMENUM to fetch from Tvb.
A ProtField type FRAMENUM cannot fetch value from a Tvb.
Change-Id: Iff0f6df8b00445855c9030dcfa753daa62262171
Reviewed-on: https://code.wireshark.org/review/11832
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/wslua/wslua_tree.c')
-rw-r--r-- | epan/wslua/wslua_tree.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/wslua/wslua_tree.c b/epan/wslua/wslua_tree.c index 773b6b1c91..a002d2708e 100644 --- a/epan/wslua/wslua_tree.c +++ b/epan/wslua/wslua_tree.c @@ -415,6 +415,10 @@ static int TreeItem_add_item_any(lua_State *L, gboolean little_endian) { lua_remove(L,1); } else { + if (type == FT_FRAMENUM) { + luaL_error(L, "ProtoField FRAMENUM cannot fetch value from Tvb"); + return 0; + } /* the Lua stack is empty - no value was given - so decode the value from the tvb */ if (type == FT_STRINGZ) tvbr->len = tvb_strsize (tvbr->tvb->ws_tvb, tvbr->offset); item = proto_tree_add_item(tree_item->tree, hfid, tvbr->tvb->ws_tvb, tvbr->offset, tvbr->len, little_endian ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN); |