Date: Thursday, December 21, 2017 @ 18:25:31 Author: heftig Revision: 313494
1.8.10-4 Modified: network-manager-applet/trunk/0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch network-manager-applet/trunk/PKGBUILD -----------------------------------------------------------------+ 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch | 42 ++-------- PKGBUILD | 4 2 files changed, 12 insertions(+), 34 deletions(-) Modified: 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch =================================================================== --- 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch 2017-12-21 17:41:59 UTC (rev 313493) +++ 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch 2017-12-21 18:25:31 UTC (rev 313494) @@ -1,8 +1,8 @@ -From 8147a06b45ef4fc6983454b63fe81a460f761593 Mon Sep 17 00:00:00 2001 -Message-Id: <8147a06b45ef4fc6983454b63fe81a460f761593.1513877605.git.jan.steff...@gmail.com> +From d4dee89e97952dff63a65ea850ab7aeac2d1f9c0 Mon Sep 17 00:00:00 2001 +Message-Id: <d4dee89e97952dff63a65ea850ab7aeac2d1f9c0.1513880568.git.jan.steff...@gmail.com> From: "Jan Alexander Steffens (heftig)" <[email protected]> Date: Thu, 21 Dec 2017 18:22:55 +0100 -Subject: [PATCH] shared/compat: fix memory handling of +Subject: [PATCH] shared/compat: Fix memory handling of nm_setting_vpn_get_*_keys (v2) The compat implementations return a (transfer none) strv instead of a @@ -12,41 +12,23 @@ We still need to copy the keys because nm_setting_vpn_foreach_* provides us with copies that are freed after the iteration. -Fix this by handing out a duplicate of the array. Also simplify the -function a bit by caching the entire GPtrArray object and not just the -array itself. +Fix this by handing out a duplicate of the array. Fixes: 272439cb2077a889485dd195bb6b99ca91d3e3bf --- - shared/nm-utils/nm-compat.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) + shared/nm-utils/nm-compat.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/nm-utils/nm-compat.c b/shared/nm-utils/nm-compat.c -index 22ab675de8373639..2b747c700478a205 100644 +index 22ab675de8373639..ba50a509a3a5f530 100644 --- a/shared/nm-utils/nm-compat.c +++ b/shared/nm-utils/nm-compat.c -@@ -38,34 +38,32 @@ _get_keys (NMSettingVpn *setting, - gboolean is_secrets, - guint *out_length) - { -- guint len; - const char **keys = NULL; - gs_unref_ptrarray GPtrArray *a = NULL; - - nm_assert (NM_IS_SETTING_VPN (setting)); - - a = g_ptr_array_new (); - if (is_secrets) - nm_setting_vpn_foreach_secret (setting, _get_keys_cb, a); - else - nm_setting_vpn_foreach_data_item (setting, _get_keys_cb, a); -- len = a->len; - +@@ -54,15 +54,15 @@ _get_keys (NMSettingVpn *setting, if (a->len) { g_ptr_array_sort (a, nm_strcmp_p); g_ptr_array_add (a, NULL); - keys = (const char **) g_ptr_array_free (g_steal_pointer (&a), FALSE); -+ keys = g_memdup (a->pdata, sizeof (gpointer) * a->len); ++ keys = g_memdup (a->pdata, a->len * sizeof *keys); /* we need to cache the keys *somewhere*. */ g_object_set_qdata_full (G_OBJECT (setting), @@ -59,11 +41,7 @@ + (GDestroyNotify) g_ptr_array_unref); } -- NM_SET_OUT (out_length, len); -+ NM_SET_OUT (out_length, a->len); - return keys; - } - + NM_SET_OUT (out_length, len); -- 2.15.1 Modified: PKGBUILD =================================================================== --- PKGBUILD 2017-12-21 17:41:59 UTC (rev 313493) +++ PKGBUILD 2017-12-21 18:25:31 UTC (rev 313494) @@ -11,7 +11,7 @@ pkgdesc="Applet for managing network connections" url="https://wiki.gnome.org/Projects/NetworkManager/" pkgver=1.8.10 -pkgrel=3 +pkgrel=4 arch=(x86_64) license=(GPL2 LGPL2.1) depends=(libnm-glib libgudev gtk3 mobile-broadband-provider-info iso-codes gcr) @@ -21,7 +21,7 @@ source=("git+https://git.gnome.org/browse/network-manager-applet#commit=$_commit" 0001-shared-compat-Fix-memory-handling-of-nm_setting_vpn_.patch) sha256sums=('SKIP' - 'df8f420b116155e7fd81e9d7a13e27bc3026e63cb859a0bb533b0bc74b8c614c') + '34a9e2232dc93be3f35c5e25ed26f7a687063a55d3a21e05f77e52f469f8b71a') pkgver() { cd $pkgbase
