summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-06-16 13:01:33 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-06-16 13:01:33 -0400
commit3adf6fdbae67ecdcc24b9c247ee2e41e42acfc09 (patch)
tree184b3f399d4de61d62a7ca89f3d540dc5a6b7f9f /src/lib/elput
parentde0d69ea2dc525b3bad57e67fe81e2044133f4ff (diff)
elput: Trap for null physical seat name
It could be possible that libinput_seat_get_physical_name does not return a valid name, in which case searching for seats will fail. This small patch just checks for a valid name being passed in and if not, searches for a default seat name @fix Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_input.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index 1918216565..57b9b05d76 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -72,6 +72,7 @@ _udev_seat_create(Elput_Manager *em, const char *name)
72 72
73 eseat = calloc(1, sizeof(Elput_Seat)); 73 eseat = calloc(1, sizeof(Elput_Seat));
74 if (!eseat) return NULL; 74 if (!eseat) return NULL;
75
75 eseat->manager = em; 76 eseat->manager = em;
76 77
77 eseat->name = eina_stringshare_add(name); 78 eseat->name = eina_stringshare_add(name);
@@ -102,10 +103,15 @@ _udev_seat_named_get(Elput_Manager *em, const char *name)
102 Elput_Seat *eseat; 103 Elput_Seat *eseat;
103 Eina_List *l; 104 Eina_List *l;
104 105
106 if (!name) name = "seat0";
107
105 EINA_LIST_FOREACH(em->input.seats, l, eseat) 108 EINA_LIST_FOREACH(em->input.seats, l, eseat)
106 if (!strcmp(eseat->name, name)) return eseat; 109 if (!strcmp(eseat->name, name)) return eseat;
107 110
108 return _udev_seat_create(em, name); 111 eseat = _udev_seat_create(em, name);
112 if (!eseat) return NULL;
113
114 return eseat;
109} 115}
110 116
111static Elput_Seat * 117static Elput_Seat *