From 0f2a0e83fbb701a0836da36c16c162817d4a9b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Mon, 8 Feb 2016 11:06:10 +0100 Subject: Lua: Remove WSLUA_ERROR on dissecting error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On error in Dissector_call and DissectorTable_try we should not terminate with WSLUA_ERROR because the error is already reported in the tree with show_exception(). Change-Id: I60739f12cb8b16fe2270f47701286fd0dbf04c6f Reviewed-on: https://code.wireshark.org/review/13819 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- epan/wslua/wslua_dissector.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/epan/wslua/wslua_dissector.c b/epan/wslua/wslua_dissector.c index f68dfafd2b..abea124b08 100644 --- a/epan/wslua/wslua_dissector.c +++ b/epan/wslua/wslua_dissector.c @@ -101,7 +101,6 @@ WSLUA_METHOD Dissector_call(lua_State* L) { Tvb tvb = checkTvb(L,WSLUA_ARG_Dissector_call_TVB); Pinfo pinfo = checkPinfo(L,WSLUA_ARG_Dissector_call_PINFO); TreeItem ti = checkTreeItem(L,WSLUA_ARG_Dissector_call_TREE); - const char *volatile error = NULL; int len = 0; if (! ( d && tvb && pinfo) ) return 0; @@ -111,11 +110,8 @@ WSLUA_METHOD Dissector_call(lua_State* L) { /* XXX Are we sure about this??? is this the right/only thing to catch */ } CATCH_NONFATAL_ERRORS { show_exception(tvb->ws_tvb, pinfo->ws_pinfo, ti->tree, EXCEPT_CODE, GET_MESSAGE); - error = "Malformed frame"; } ENDTRY; - if (error) { WSLUA_ERROR(Dissector_call,error); } - lua_pushnumber(L,(lua_Number)len); WSLUA_RETURN(1); /* Number of bytes dissected. Note that some dissectors always return number of bytes in incoming buffer, so be aware. */ } @@ -528,7 +524,6 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) { TreeItem ti = checkTreeItem(L,WSLUA_ARG_DissectorTable_try_TREE); ftenum_t type; gboolean handled = FALSE; - const gchar *volatile error = NULL; int len = 0; if (! (dt && tvb && tvb->ws_tvb && pinfo && ti) ) return 0; @@ -561,11 +556,8 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) { /* XXX Are we sure about this??? is this the right/only thing to catch */ } CATCH_NONFATAL_ERRORS { show_exception(tvb->ws_tvb, pinfo->ws_pinfo, ti->tree, EXCEPT_CODE, GET_MESSAGE); - error = "Malformed frame"; } ENDTRY; - if (error) { WSLUA_ERROR(DissectorTable_try,error); } - lua_pushnumber(L,(lua_Number)len); WSLUA_RETURN(1); /* Number of bytes dissected. Note that some dissectors always return number of bytes in incoming buffer, so be aware. */ } -- cgit v1.2.3