From 89900bcf4df0fa9c205ea25a4f060907a95f454d Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 20 Feb 2024 16:21:11 +0100 Subject: [PATCH] eventcomm: fix possible buffer overflow eventcomm.c: In function 'EventAutoDevProbe': eventcomm.c:1045:32: warning: '%s' directive writing up to 255 bytes into a region of size 53 [-Wformat-overflow=] 1045 | sprintf(fname, "%s/%s", DEV_INPUT_EVENT, namelist[i]->d_name); | ^~ eventcomm.c:1045:13: note: 'sprintf' output between 12 and 267 bytes into a destination of size 64 1045 | sprintf(fname, "%s/%s", DEV_INPUT_EVENT, namelist[i]->d_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- src/eventcomm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eventcomm.c b/src/eventcomm.c index 6f2a2a0..05cfec1 100644 --- a/src/eventcomm.c +++ b/src/eventcomm.c @@ -1033,7 +1033,7 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device) } while (i--) { - char fname[64]; + char fname[PATH_MAX]; int fd = -1; if (!touchpad_found) {