aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-02-08 21:59:47 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2016-02-08 21:59:55 +0000
commit0ae6a19f7dbd560c6f6a06a6470472eea0c24fda (patch)
tree4d07aa1d439a78671c0aebd53ea693702df28c4b /epan/wslua
parent2e6d7805ede6a3a3a7078422345e7cf743e3486e (diff)
Revert "Lua: Remove WSLUA_ERROR on dissecting error"
This reverts commit 0f2a0e83fbb701a0836da36c16c162817d4a9b2f. Change-Id: Ifc40f99385a5948a033bb611b4ce8a0fa615b333 Reviewed-on: https://code.wireshark.org/review/13837 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/wslua')
-rw-r--r--epan/wslua/wslua_dissector.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/wslua/wslua_dissector.c b/epan/wslua/wslua_dissector.c
index abea124b08..f68dfafd2b 100644
--- a/epan/wslua/wslua_dissector.c
+++ b/epan/wslua/wslua_dissector.c
@@ -101,6 +101,7 @@ 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;
@@ -110,8 +111,11 @@ 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. */
}
@@ -524,6 +528,7 @@ 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;
@@ -556,8 +561,11 @@ 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. */
}