[glib/wip/2-58-cve-2021-27219: 1/3] gvariant test: Use g_memdup2
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/2-58-cve-2021-27219: 1/3] gvariant test: Use g_memdup2
- Date: Fri, 19 Mar 2021 10:08:13 +0000 (UTC)
commit 65be56a1235698b7085484ced53ecebc51e53f23
Author: Simon McVittie <smcv collabora com>
Date: Thu Mar 18 10:33:32 2021 +0000
gvariant test: Use g_memdup2
This code no longer existed on the glib-2-66 branch, but it's present
in glib-2-58. It's easier to verify that all potentially problematic
g_memdup() uses have been replaced if we replace these too.
Helps: #2319
Signed-off-by: Simon McVittie <smcv collabora com>
glib/tests/gvariant.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
index 18800f980..5d984c3db 100644
--- a/glib/tests/gvariant.c
+++ b/glib/tests/gvariant.c
@@ -4779,7 +4779,7 @@ test_normal_checking_tuples (void)
GVariant *variant = NULL;
GVariant *normal_variant = NULL;
- aligned_data = g_memdup (data, size); /* guarantee alignment */
+ aligned_data = g_memdup2 (data, size); /* guarantee alignment */
variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data, size,
FALSE, NULL, NULL);
g_assert_nonnull (variant);
@@ -4908,7 +4908,7 @@ test_normal_checking_array_offsets (void)
GVariant *variant = NULL;
GVariant *normal_variant = NULL;
- aligned_data = g_memdup (data, size); /* guarantee alignment */
+ aligned_data = g_memdup2 (data, size); /* guarantee alignment */
variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data, size,
FALSE, NULL, NULL);
g_assert_nonnull (variant);
@@ -4935,7 +4935,7 @@ test_normal_checking_tuple_offsets (void)
GVariant *variant = NULL;
GVariant *normal_variant = NULL;
- aligned_data = g_memdup (data, size); /* guarantee alignment */
+ aligned_data = g_memdup2 (data, size); /* guarantee alignment */
variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data,
size, FALSE, NULL, NULL);
g_assert_nonnull (variant);
@@ -4962,7 +4962,7 @@ test_normal_checking_empty_object_path (void)
GVariant *variant = NULL;
GVariant *normal_variant = NULL;
- aligned_data = g_memdup (data, size); /* guarantee alignment */
+ aligned_data = g_memdup2 (data, size); /* guarantee alignment */
variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data, size,
FALSE, NULL, NULL);
g_assert_nonnull (variant);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]