From 84465bd64be72235bd1184c1b45917f45c96518c Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Sat, 30 Jul 2016 20:01:11 -0300 Subject: Ensure buffer is large enough while scanning input devices --- modules/devices/inputdevices.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/devices/inputdevices.c b/modules/devices/inputdevices.c index 5bd6c214..d3f8847f 100644 --- a/modules/devices/inputdevices.c +++ b/modules/devices/inputdevices.c @@ -38,9 +38,9 @@ void __scan_input_devices(void) { FILE *dev; - gchar buffer[128]; + gchar buffer[1024]; gchar *tmp, *name = NULL, *phys = NULL; - gint bus = 0, vendor, product, version; + gint bus = 0, vendor = 0, product = 0, version = 0; int d = 0, n = 0; dev = fopen("/proc/bus/input/devices", "r"); @@ -55,7 +55,7 @@ __scan_input_devices(void) input_list = g_strdup(""); input_icons = g_strdup(""); - while (fgets(buffer, 128, dev)) { + while (fgets(buffer, sizeof(buffer), dev)) { tmp = buffer; switch (*tmp) { -- cgit v1.2.3