aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-03-11 07:36:49 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2018-03-11 06:39:12 +0000
commit45366965071840698a3fa11aace1d8eadae1802c (patch)
treeb7ae6f81bbfba41deacc570a6edc388d5b68f023
parentfc6b725b18d9d627534c3b61720f5be93315ce09 (diff)
DOF: restore correct memory scope for decrypted buffer
Change-Id: I143f73f7921187bac5de46cd07344b015a06a578 Reviewed-on: https://code.wireshark.org/review/26420 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/packet-dof.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dof.c b/epan/dissectors/packet-dof.c
index a3e4d9b829..94dec73ef1 100644
--- a/epan/dissectors/packet-dof.c
+++ b/epan/dissectors/packet-dof.c
@@ -7916,7 +7916,8 @@ static int dissect_ccm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
{
if (decrypt(session, pdata, nonce, epp_buf, a_len, buf, e_len))
{
- guint8 *cache = (guint8 *)wmem_alloc0(pinfo->pool, e_len - session->mac_len);
+ /* store decrypted buffer in file scope for reuse in next pass */
+ guint8 *cache = (guint8 *)wmem_alloc0(wmem_file_scope(), e_len - session->mac_len);
memcpy(cache, buf, e_len - session->mac_len);
app = tvb_new_real_data(cache, e_len - session->mac_len, e_len - session->mac_len);
tvb_set_child_real_data_tvbuff(tvb, app);