aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2021-03-23 16:41:54 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-03-25 09:38:10 +0000
commitea929d6401351916e0abca7429979eee9c47d3f2 (patch)
tree522492a802e608e8049fa5a3586477053002bce0 /dumpcap.c
parente6df13076281a704e9dd1aa8c2afe3e7dce015e3 (diff)
wsutils: add local implementation of g_memdup2.
g_memdup() was deprecated and replaced with g_memdup2() in GLib 2.68, we provide our own copy of g_memdup2() for older GLib versions.
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 609efa488a..e7e976b77d 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -86,6 +86,7 @@
#include "wsutil/inet_addr.h"
#include "wsutil/time_util.h"
#include "wsutil/please_report_bug.h"
+#include "wsutil/glib-compat.h"
#include "caputils/ws80211_utils.h"
@@ -2116,7 +2117,7 @@ pcapng_adjust_block(capture_src *pcap_src, const pcapng_block_header_t *bh, u_ch
* buffer files.
*/
g_free(global_ld.saved_shb);
- global_ld.saved_shb = (guint8 *) g_memdup(pd, bh->block_total_length);
+ global_ld.saved_shb = (guint8 *) g_memdup2(pd, bh->block_total_length);
/*
* We're dealing with one section at a time, so we can (and must)
@@ -2155,7 +2156,7 @@ pcapng_adjust_block(capture_src *pcap_src, const pcapng_block_header_t *bh, u_ch
saved_idb_t idb_source = { 0 };
idb_source.interface_id = pcap_src->interface_id;
idb_source.idb_len = bh->block_total_length;
- idb_source.idb = (guint8 *) g_memdup(pd, idb_source.idb_len);
+ idb_source.idb = (guint8 *) g_memdup2(pd, idb_source.idb_len);
g_array_append_val(global_ld.saved_idbs, idb_source);
guint32 iface_id = global_ld.saved_idbs->len - 1;
g_array_append_val(pcap_src->cap_pipe_info.pcapng.src_iface_to_global, iface_id);