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.
This commit is contained in:
Nikos Tsipinakis 2017-01-21 09:13:03 +02:00
parent 1e477395d9
commit bba3cfe700

View File

@ -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