diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-15 20:53:28 +0100 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-15 19:56:38 +0000 |
commit | a8e774034b188662f29a41e3ff86ec96068bd025 (patch) | |
tree | d6e44e5cb60caf7afd4eacff70f3239d9f462fd3 | |
parent | 25fd5b5ca6bd615723a44d599bca6dd345565675 (diff) |
Lua: Check for nil valuestring for integer fields.
Added a check for nil valuestring for all ProtoField integer types
to avoid lookup when argument is not set.
Change-Id: Ib4c016b69ee77dbea4bb83ac93c0d9ae9f48f236
Reviewed-on: https://code.wireshark.org/review/11845
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r-- | epan/wslua/wslua_proto_field.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/wslua/wslua_proto_field.c b/epan/wslua/wslua_proto_field.c index 97c4ea8f30..9275c9e5b9 100644 --- a/epan/wslua/wslua_proto_field.c +++ b/epan/wslua/wslua_proto_field.c @@ -515,7 +515,7 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) { guint32 mask = wslua_optguint32(L,5,0); const gchar* blob = luaL_optstring(L,6,NULL); - if (lua_gettop(L) > 3) { + if (lua_gettop(L) > 3 && !lua_isnil(L, 4)) { if (type == FT_FRAMENUM) { framenum_type = (enum ft_framenum_type) luaL_checkinteger(L, 4); if (framenum_type >= FT_FRAMENUM_NUM_TYPES) { |