From bba3cfe7008c728c46a951a2915cde816eb257ee Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Sat, 21 Jan 2017 09:13:03 +0200 Subject: [PATCH] Fix segfault when checking for duplicate notifications with raw icons If a notification has a raw icon, icon is set to NULL which was passed without checking to strcmp. We don't (yet) support comparing raw icons so if a raw icon is set, we can safely assume the notification is not a duplicate. --- src/notification.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/notification.c b/src/notification.c index 5f0f43c..e6c2386 100644 --- a/src/notification.c +++ b/src/notification.c @@ -146,6 +146,11 @@ int notification_cmp_data(const void *va, const void *vb, void *data) int notification_is_duplicate(const notification *a, const notification *b) { + //Comparing raw icons is not supported, assume they are not identical + if (settings.icon_position != icons_off + && (a->raw_icon != NULL || b->raw_icon != NULL)) + return false + return strcmp(a->appname, b->appname) == 0 && strcmp(a->summary, b->summary) == 0 && strcmp(a->body, b->body) == 0