diff options
author | Dario Lombardo <lomato@gmail.com> | 2021-03-23 16:41:54 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-03-25 09:38:10 +0000 |
commit | ea929d6401351916e0abca7429979eee9c47d3f2 (patch) | |
tree | 522492a802e608e8049fa5a3586477053002bce0 /epan/crypt | |
parent | e6df13076281a704e9dd1aa8c2afe3e7dce015e3 (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 'epan/crypt')
-rw-r--r-- | epan/crypt/dot11decrypt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/crypt/dot11decrypt.c b/epan/crypt/dot11decrypt.c index c055127ce4..a9c1e40971 100644 --- a/epan/crypt/dot11decrypt.c +++ b/epan/crypt/dot11decrypt.c @@ -16,6 +16,7 @@ #include <wsutil/wsgcrypt.h> #include <wsutil/crc32.h> #include <wsutil/pint.h> +#include <wsutil/glib-compat.h> #include <epan/proto.h> /* for DISSECTOR_ASSERT. */ #include <epan/tvbuff.h> @@ -367,7 +368,7 @@ Dot11DecryptRc4KeyData(const guint8 *decryption_key, guint decryption_key_len, gcry_cipher_close(rc4_handle); return NULL; } - decrypted_key = (guint8 *)g_memdup(encrypted_keydata, encrypted_keydata_len); + decrypted_key = (guint8 *)g_memdup2(encrypted_keydata, encrypted_keydata_len); if (!decrypted_key) { gcry_cipher_close(rc4_handle); return NULL; @@ -573,7 +574,7 @@ Dot11DecryptAddSa( if (existing_sa != NULL) { sa = Dot11DecryptPrependSa(existing_sa, sa); } else { - void *key = g_memdup(id, sizeof(DOT11DECRYPT_SEC_ASSOCIATION_ID)); + void *key = g_memdup2(id, sizeof(DOT11DECRYPT_SEC_ASSOCIATION_ID)); g_hash_table_insert(ctx->sa_hash, key, sa); } return sa; |