From 8a9980cd06d0a72d271738b96fe71ddd5a56ce12 Mon Sep 17 00:00:00 2001 From: Francesco Valla Date: Fri, 3 Apr 2020 10:50:48 +0200 Subject: [PATCH] pc/serial_unix: bump device path buffer size to 4096 bytes Since dp->d_name can be up to 255 bytes long and the 'name' buffer variable is is a superset of it, bump the size of the latter to 4096 bytes (correspoding to PATH_MAX on Linux systems). --- src/platforms/pc/serial_unix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/platforms/pc/serial_unix.c b/src/platforms/pc/serial_unix.c index c4688b08..cc186578 100644 --- a/src/platforms/pc/serial_unix.c +++ b/src/platforms/pc/serial_unix.c @@ -71,7 +71,7 @@ static int set_interface_attribs(void) #define DEVICE_BY_ID "/dev/serial/by-id/" int serial_open(BMP_CL_OPTIONS_t *opt) { - char name[256]; + char name[4096]; if (!opt->opt_device) { /* Try to find some BMP if0*/ struct dirent *dp; @@ -212,4 +212,3 @@ int platform_buffer_read(uint8_t *data, int maxsize) exit(-3); return 0; } -