aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff_composite.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-04-21 19:12:26 +0200
committerAnders Broman <a.broman58@gmail.com>2016-04-22 04:32:32 +0000
commit9abbf8b69d830bff29705991d6ebb760ec2f4454 (patch)
tree7a75eda3bf85ae8846511215c4c0ef0a42ca1940 /epan/tvbuff_composite.c
parent9de18e88f501ef953395b8cadf9dbc9b79ce40cc (diff)
downloadwireshark-9abbf8b69d830bff29705991d6ebb760ec2f4454.tar.gz
wireshark-9abbf8b69d830bff29705991d6ebb760ec2f4454.tar.bz2
wireshark-9abbf8b69d830bff29705991d6ebb760ec2f4454.zip
Do not mix wmem and glib allocators
Change-Id: I0e845668a1b9dbec93ea920a8585ecfe60f001d1 Reviewed-on: https://code.wireshark.org/review/15044 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/tvbuff_composite.c')
-rw-r--r--epan/tvbuff_composite.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/tvbuff_composite.c b/epan/tvbuff_composite.c
index 6d9d98557b..15bf96b2c0 100644
--- a/epan/tvbuff_composite.c
+++ b/epan/tvbuff_composite.c
@@ -112,7 +112,13 @@ composite_get_ptr(tvbuff_t *tvb, guint abs_offset, guint abs_length)
return tvb_get_ptr(member_tvb, member_offset, abs_length);
}
else {
- tvb->real_data = (guint8 *)tvb_memdup(NULL, tvb, 0, -1);
+ abs_offset = 0;
+ abs_length = 0;
+
+ tvb_check_offset_length(tvb, 0, -1, &abs_offset, &abs_length);
+
+ tvb->real_data = (guint8 *)g_malloc(abs_length);
+ tvb_memcpy(tvb, (void *)tvb->real_data, 0, abs_length);
return tvb->real_data + abs_offset;
}