[PackageKit] Fix another gnome-settings-daemon crash
Richard Hughes
rhughes at fedoraproject.org
Fri Jan 27 17:30:10 UTC 2012
commit f2930e6870e33f56d033ac84a382b50a1a6869ca
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Jan 27 17:29:26 2012 +0000
Fix another gnome-settings-daemon crash
PackageKit.spec | 5 ++-
null-is-not-a-string.patch | 69 +++++++++++++++++++++++++++++++++++++++++--
2 files changed, 69 insertions(+), 5 deletions(-)
---
diff --git a/PackageKit.spec b/PackageKit.spec
index 7629b66..cbc15de 100644
--- a/PackageKit.spec
+++ b/PackageKit.spec
@@ -3,7 +3,7 @@
Summary: Package management service
Name: PackageKit
Version: 0.7.2
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2+ and LGPLv2+
URL: http://www.packagekit.org
Source0: http://www.packagekit.org/releases/%{name}-%{version}.tar.xz
@@ -461,6 +461,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%{_libdir}/pkgconfig/packagekit-plugin.pc
%changelog
+* Fri Jan 27 2012 Richard Hughes <rhughes at redhat.com> - 0.7.2-5
+- Fix another gnome-settings-daemon crash
+
* Thu Jan 26 2012 Richard Hughes <rhughes at redhat.com> - 0.7.2-4
- Add back the preupgrade Require to fix a warning in g-s-d.
diff --git a/null-is-not-a-string.patch b/null-is-not-a-string.patch
index fe1e460..78b664f 100644
--- a/null-is-not-a-string.patch
+++ b/null-is-not-a-string.patch
@@ -1,7 +1,41 @@
-diff -up PackageKit-0.7.2/lib/packagekit-glib2/pk-control.c.null PackageKit-0.7.2/lib/packagekit-glib2/pk-control.c
---- PackageKit-0.7.2/lib/packagekit-glib2/pk-control.c.null 2012-01-20 00:02:52.422053263 -0500
-+++ PackageKit-0.7.2/lib/packagekit-glib2/pk-control.c 2012-01-20 00:04:04.368050690 -0500
-@@ -1175,12 +1175,12 @@ pk_control_set_proxy2_async (PkControl *
+diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c
+index f6d4026..9acb1ba 100644
+--- a/lib/packagekit-glib2/pk-client.c
++++ b/lib/packagekit-glib2/pk-client.c
+@@ -1426,7 +1426,7 @@ pk_client_proxy_connect (PkClientState *state)
+
+ /* coldplug properties */
+ props = g_dbus_proxy_get_cached_property_names (state->proxy);
+- for (i = 0; props[i] != NULL; i++) {
++ for (i = 0; props != NULL && props[i] != NULL; i++) {
+ value_tmp = g_dbus_proxy_get_cached_property (state->proxy,
+ props[i]);
+ pk_client_set_property_value (state,
+@@ -1844,8 +1844,8 @@ pk_client_set_hints_cb (GObject *source_object,
+ g_dbus_proxy_call (state->proxy, "RepoSetData",
+ g_variant_new ("(sss)",
+ state->repo_id,
+- state->parameter,
+- state->value),
++ state->parameter ? state->parameter : "",
++ state->value ? state->value : ""),
+ G_DBUS_CALL_FLAGS_NONE,
+ PK_CLIENT_DBUS_METHOD_TIMEOUT,
+ state->cancellable,
+diff --git a/lib/packagekit-glib2/pk-control.c b/lib/packagekit-glib2/pk-control.c
+index 3ae9d94..e205dcb 100644
+--- a/lib/packagekit-glib2/pk-control.c
++++ b/lib/packagekit-glib2/pk-control.c
+@@ -377,7 +377,7 @@ pk_control_proxy_connect (PkControlState *state)
+
+ /* coldplug properties */
+ props = g_dbus_proxy_get_cached_property_names (state->proxy);
+- for (i = 0; props[i] != NULL; i++) {
++ for (i = 0; props != NULL && props[i] != NULL; i++) {
+ value_tmp = g_dbus_proxy_get_cached_property (state->proxy,
+ props[i]);
+ pk_control_set_property_value (state->control,
+@@ -1175,12 +1175,13 @@ pk_control_set_proxy2_async (PkControl *control,
state->res = g_object_ref (res);
state->control = g_object_ref (control);
state->parameters = g_variant_new ("(ssssss)",
@@ -17,6 +51,33 @@ diff -up PackageKit-0.7.2/lib/packagekit-glib2/pk-control.c.null PackageKit-0.7.
+ proxy_socks ? proxy_socks : "",
+ no_proxy ? no_proxy : "",
+ pac ? pac : "");
++ g_variant_ref_sink (state->parameters);
+ if (cancellable != NULL)
+ state->cancellable = g_object_ref (cancellable);
+
+@@ -1425,7 +1426,8 @@ pk_control_set_root_async (PkControl *control,
+ state = g_slice_new0 (PkControlState);
+ state->res = g_object_ref (res);
+ state->control = g_object_ref (control);
+- state->parameters = g_variant_new ("(s)", root);
++ state->parameters = g_variant_new ("(s)", root ? root : "");
++ g_variant_ref_sink (state->parameters);
+ if (cancellable != NULL)
+ state->cancellable = g_object_ref (cancellable);
+
+@@ -1862,6 +1864,7 @@ pk_control_get_time_since_action_async (PkControl *control,
+ state->res = g_object_ref (res);
+ state->control = g_object_ref (control);
+ state->parameters = g_variant_new ("(s)", pk_role_enum_to_string (role));
++ g_variant_ref_sink (state->parameters);
+ if (cancellable != NULL)
+ state->cancellable = g_object_ref (cancellable);
+
+@@ -2081,6 +2084,7 @@ pk_control_can_authorize_async (PkControl *control,
+ state->res = g_object_ref (res);
+ state->control = g_object_ref (control);
+ state->parameters = g_variant_new ("(s)", action_id);
++ g_variant_ref_sink (state->parameters);
if (cancellable != NULL)
state->cancellable = g_object_ref (cancellable);
More information about the scm-commits
mailing list