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 <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics/-/merge_requests/15>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-02-20 16:21:11 +01:00
committed by Marge Bot
parent 373139dd06
commit 89900bcf4d

View File

@@ -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) {