diff options
author | Guy Harris <gharris@sonic.net> | 2021-03-28 02:31:37 +0000 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-03-28 03:01:34 +0000 |
commit | 193b1fc545c0cf71b35f7e8f1d921a81299c06b3 (patch) | |
tree | 5bd0b340de15b45fad7f41e38e7db1a7eb669316 /epan/wslua | |
parent | 6ef6e8f607456e239e5f1a326803846930d34fa8 (diff) |
wslua_tvb: correctly trim off the end of a tvbuff.
The length specified in a TvbRange is the *actual packet length*, not
the *sliced-to* length, so use tvb_new_subset_length() to cut it short.
This fixes the fix for #15655, and addresses at least some of the issues
in #17255.
(cherry picked from commit cda18f951ebfe53dc5bbb841618dc12e31b38ec6)
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_tvb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/wslua/wslua_tvb.c b/epan/wslua/wslua_tvb.c index ee6f8d9ef7..8d01ddc66e 100644 --- a/epan/wslua/wslua_tvb.c +++ b/epan/wslua/wslua_tvb.c @@ -399,8 +399,7 @@ WSLUA_METHOD TvbRange_tvb(lua_State *L) { tvb = (Tvb)g_malloc(sizeof(struct _wslua_tvb)); tvb->expired = FALSE; tvb->need_free = FALSE; - // -1 means recalculate the reported_len based on the new offset - tvb->ws_tvb = tvb_new_subset_length_caplen(tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len,-1); + tvb->ws_tvb = tvb_new_subset_length(tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len); return push_wsluaTvb(L, tvb); } else { luaL_error(L,"Out Of Bounds"); |