r32001 - in /packages/unstable/notification-daemon/debian: changelog patches/01_avoid_crash_for_boolean_hints.patch patches/series
biebl at users.alioth.debian.org
biebl at users.alioth.debian.org
Fri Dec 9 15:46:11 UTC 2011
Author: biebl
Date: Fri Dec 9 15:46:11 2011
New Revision: 32001
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=32001
Log:
* debian/patches/01_avoid_crash_for_boolean_hints.patch:
- Avoid crashes for boolean hints. (Closes: 636323)
Thanks anomie at users.sourceforge.net for the patch.
Added:
packages/unstable/notification-daemon/debian/patches/01_avoid_crash_for_boolean_hints.patch
Modified:
packages/unstable/notification-daemon/debian/changelog
packages/unstable/notification-daemon/debian/patches/series
Modified: packages/unstable/notification-daemon/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/notification-daemon/debian/changelog?rev=32001&op=diff
==============================================================================
--- packages/unstable/notification-daemon/debian/changelog [utf-8] (original)
+++ packages/unstable/notification-daemon/debian/changelog [utf-8] Fri Dec 9 15:46:11 2011
@@ -1,3 +1,11 @@
+notification-daemon (0.7.3-2) UNRELEASED; urgency=low
+
+ * debian/patches/01_avoid_crash_for_boolean_hints.patch:
+ - Avoid crashes for boolean hints. (Closes: 636323)
+ Thanks anomie at users.sourceforge.net for the patch.
+
+ -- Michael Biebl <biebl at debian.org> Fri, 09 Dec 2011 16:45:04 +0100
+
notification-daemon (0.7.3-1) unstable; urgency=low
* New upstream release.
Added: packages/unstable/notification-daemon/debian/patches/01_avoid_crash_for_boolean_hints.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/notification-daemon/debian/patches/01_avoid_crash_for_boolean_hints.patch?rev=32001&op=file
==============================================================================
--- packages/unstable/notification-daemon/debian/patches/01_avoid_crash_for_boolean_hints.patch (added)
+++ packages/unstable/notification-daemon/debian/patches/01_avoid_crash_for_boolean_hints.patch [utf-8] Fri Dec 9 15:46:11 2011
@@ -1,0 +1,92 @@
+Description: Avoid crashes for boolean hints
+ Check the type of the incoming hint and use the appropriate
+ g_variant_get_* function.
+ It also applies the same fix for the "resident" and "action-icons"
+ hints.
+Author: anomie at users.sourceforge.net
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636323
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665166
+--- a/src/nd-notification.c
++++ b/src/nd-notification.c
+@@ -224,54 +224,53 @@
+ }
+
+ gboolean
+-nd_notification_get_is_transient (NdNotification *notification)
++nd_notification_get_bool (NdNotification *notification, const char *name)
+ {
+ gboolean ret;
+ GVariant *value;
+-
+ ret = FALSE;
+ g_return_val_if_fail (ND_IS_NOTIFICATION (notification), FALSE);
+
+- value = g_hash_table_lookup (notification->hints, "transient");
++ value = g_hash_table_lookup (notification->hints, name);
+ if (value != NULL) {
+- ret = g_variant_get_boolean (value);
++ if (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN)) {
++ ret = g_variant_get_boolean (value);
++ } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_BYTE)) {
++ ret = (g_variant_get_byte (value) != 0);
++ } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT16)) {
++ ret = (g_variant_get_int16 (value) != 0);
++ } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT16)) {
++ ret = (g_variant_get_uint16 (value) != 0);
++ } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)) {
++ ret = (g_variant_get_int32 (value) != 0);
++ } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT32)) {
++ ret = (g_variant_get_uint32 (value) != 0);
++ } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT64)) {
++ ret = (g_variant_get_int64 (value) != 0);
++ } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT64)) {
++ ret = (g_variant_get_uint64 (value) != 0);
++ }
+ }
+
+ return ret;
+ }
+
+ gboolean
+-nd_notification_get_is_resident (NdNotification *notification)
++nd_notification_get_is_transient (NdNotification *notification)
+ {
+- gboolean ret;
+- GVariant *value;
+-
+- ret = FALSE;
+- g_return_val_if_fail (ND_IS_NOTIFICATION (notification), FALSE);
+-
+- value = g_hash_table_lookup (notification->hints, "resident");
+- if (value != NULL) {
+- ret = g_variant_get_boolean (value);
+- }
++ return nd_notification_get_bool (notification, "transient");
++}
+
+- return ret;
++gboolean
++nd_notification_get_is_resident (NdNotification *notification)
++{
++ return nd_notification_get_bool (notification, "resident");
+ }
+
+ gboolean
+ nd_notification_get_action_icons (NdNotification *notification)
+ {
+- gboolean ret;
+- GVariant *value;
+-
+- ret = FALSE;
+- g_return_val_if_fail (ND_IS_NOTIFICATION (notification), FALSE);
+-
+- value = g_hash_table_lookup (notification->hints, "action-icons");
+- if (value != NULL) {
+- ret = g_variant_get_boolean (value);
+- }
+-
+- return ret;
++ return nd_notification_get_bool (notification, "action-icons");
+ }
+
+ guint32
Modified: packages/unstable/notification-daemon/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/notification-daemon/debian/patches/series?rev=32001&op=diff
==============================================================================
--- packages/unstable/notification-daemon/debian/patches/series [utf-8] (original)
+++ packages/unstable/notification-daemon/debian/patches/series [utf-8] Fri Dec 9 15:46:11 2011
@@ -1,1 +1,2 @@
+01_avoid_crash_for_boolean_hints.patch
99_ltmain_as-needed.patch
More information about the pkg-gnome-commits
mailing list