mirror of
https://github.com/swaywm/sway.git
synced 2025-11-02 09:01:40 -05:00
Don't trust SNI names, fixes #1274
If an item doesn't have a well-formed name, it will not be added to the tray.
This commit is contained in:
parent
13ed84e886
commit
62223e8fbb
3 changed files with 16 additions and 5 deletions
|
|
@ -413,6 +413,12 @@ static void get_unique_name(struct StatusNotifierItem *item) {
|
|||
}
|
||||
|
||||
struct StatusNotifierItem *sni_create(const char *name) {
|
||||
// Make sure `name` is well formed
|
||||
if (!dbus_validate_bus_name(name, NULL)) {
|
||||
sway_log(L_INFO, "Name (%s) is not a bus name. We cannot create an item.", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct StatusNotifierItem *item = malloc(sizeof(struct StatusNotifierItem));
|
||||
item->name = strdup(name);
|
||||
item->unique_name = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue