mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-26 00:55:14 +00:00
- Add a patch which checks the D-BUS struct type of the icon-data
correctly that is being sent trough libnotify (written by Milosz Derezynski) - Bump PORTREVISION Submitted by: Andreas Kohn (maintainer)
This commit is contained in:
parent
183e8c6b13
commit
ea92a7a301
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=168070
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= notification-daemon
|
||||
PORTVERSION= 0.3.5
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= deskutils gnome
|
||||
MASTER_SITES= http://www.galago-project.org/files/releases/source/notification-daemon/
|
||||
|
||||
|
62
deskutils/notification-daemon/files/patch-src-daemon.c
Normal file
62
deskutils/notification-daemon/files/patch-src-daemon.c
Normal file
@ -0,0 +1,62 @@
|
||||
diff -Naur notification-daemon-0.3.5.orig/src/daemon.c notification-daemon-0.3.5/src/daemon.c
|
||||
--- src/daemon.c 2006-04-26 10:32:50.000000000 +0200
|
||||
+++ src/daemon.c 2006-06-18 05:07:47.000000000 +0200
|
||||
@@ -399,14 +399,54 @@
|
||||
GValueArray *image_struct;
|
||||
GValue *value;
|
||||
GArray *tmp_array;
|
||||
+ GType type = G_VALUE_TYPE (icon_data);
|
||||
+
|
||||
+ static const GType types[] = {
|
||||
+ G_TYPE_INT,
|
||||
+ G_TYPE_INT,
|
||||
+ G_TYPE_INT,
|
||||
+ G_TYPE_BOOLEAN,
|
||||
+ G_TYPE_INT,
|
||||
+ G_TYPE_INT
|
||||
+ };
|
||||
+
|
||||
+
|
||||
+ if (dbus_g_type_is_struct (type))
|
||||
+ {
|
||||
+ int n;
|
||||
+
|
||||
+ if (dbus_g_type_get_struct_size (type) < 7)
|
||||
+ {
|
||||
+ g_warning("_notify_daemon_process_icon_data expected 7 data members, got only %d", dbus_g_type_get_struct_size (type));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ for (n = 0; n < G_N_ELEMENTS (types); ++n)
|
||||
+ {
|
||||
+ GType check = dbus_g_type_get_struct_member_type (type, n);
|
||||
+ if (check != types[n])
|
||||
+ {
|
||||
+ g_warning("_notify_daemon_process_icon_data expected '%s' at position %d, but got '%s'",
|
||||
+ g_type_name (types[n]), n, g_type_name (check));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
|
||||
- if (!G_VALUE_HOLDS(icon_data, G_TYPE_VALUE_ARRAY))
|
||||
+ /* We must check this separately as it's not a constant and can't be part of the types[] array */
|
||||
+ if (dbus_g_type_get_struct_member_type (type, 6) != DBUS_TYPE_G_UCHAR_ARRAY)
|
||||
+ {
|
||||
+ g_warning("_notify_daemon_process_icon_data expected '%s' at position %d, but got '%s'",
|
||||
+ g_type_name (DBUS_TYPE_G_UCHAR_ARRAY), 6, g_type_name (dbus_g_type_get_struct_member_type (type,6)));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
{
|
||||
- g_warning("_notify_daemon_process_icon_data expected a "
|
||||
- "GValue of type GValueArray");
|
||||
- return FALSE;
|
||||
+ g_warning("_notify_daemon_process_icon_data got wrong data");
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
+
|
||||
image_struct = (GValueArray *)g_value_get_boxed(icon_data);
|
||||
value = g_value_array_get_nth(image_struct, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user