mirror of
https://github.com/swaywm/sway.git
synced 2026-04-14 08:22:08 -04:00
Merge pull request #1276 from 4e554c4c/bad_items
Don't trust SNI names, fixes #1274
This commit is contained in:
parent
54cd2236c4
commit
0048a3e963
3 changed files with 16 additions and 5 deletions
|
|
@ -90,9 +90,11 @@ static void get_items_reply(DBusPendingCall *pending, void *_data) {
|
|||
|
||||
struct StatusNotifierItem *item = sni_create(name);
|
||||
|
||||
sway_log(L_DEBUG, "Item registered with host: %s", name);
|
||||
list_add(tray->items, item);
|
||||
dirty = true;
|
||||
if (item) {
|
||||
sway_log(L_DEBUG, "Item registered with host: %s", name);
|
||||
list_add(tray->items, item);
|
||||
dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
bail:
|
||||
|
|
@ -141,8 +143,10 @@ static DBusHandlerResult signal_handler(DBusConnection *connection,
|
|||
if (list_seq_find(tray->items, sni_str_cmp, name) == -1) {
|
||||
struct StatusNotifierItem *item = sni_create(name);
|
||||
|
||||
list_add(tray->items, item);
|
||||
dirty = true;
|
||||
if (item) {
|
||||
list_add(tray->items, item);
|
||||
dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue