aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/k12.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 /wiretap/k12.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 'wiretap/k12.c')
-rw-r--r--wiretap/k12.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/k12.c b/wiretap/k12.c
index ece5b697db..d9ee211c92 100644
--- a/wiretap/k12.c
+++ b/wiretap/k12.c
@@ -21,6 +21,7 @@
#include "k12.h"
#include <wsutil/str_util.h>
+#include <wsutil/glib-compat.h>
/*
* See
@@ -1060,8 +1061,8 @@ wtap_open_return_val k12_open(wtap *wth, int *err, gchar **err_info) {
g_free(rec);
return WTAP_OPEN_ERROR;
}
- rec->input_name = (gchar *)g_memdup(read_buffer + K12_SRCDESC_HWPART + hwpart_len, name_len);
- rec->stack_file = (gchar *)g_memdup(read_buffer + K12_SRCDESC_HWPART + hwpart_len + name_len, stack_len);
+ rec->input_name = (gchar *)g_memdup2(read_buffer + K12_SRCDESC_HWPART + hwpart_len, name_len);
+ rec->stack_file = (gchar *)g_memdup2(read_buffer + K12_SRCDESC_HWPART + hwpart_len + name_len, stack_len);
ascii_strdown_inplace (rec->stack_file);