prevent out-of-bounds copy
This commit is contained in:
parent
b66214e6a8
commit
dc01895dca
1 changed files with 2 additions and 1 deletions
|
|
@ -1401,7 +1401,8 @@ allows COM port numbers to be specified. */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
strncpy_s(test.serial_device_prefix, strlen(serial_device_prefix) + 1, serial_device_prefix, strlen(serial_device_prefix) + 1);
|
strncpy_s(test.serial_device_prefix, strlen(serial_device_prefix) + 1, serial_device_prefix, strlen(serial_device_prefix) + 1);
|
||||||
#else
|
#else
|
||||||
strncpy(test.serial_device_prefix, serial_device_prefix, MAXPDSTRING);
|
strncpy(test.serial_device_prefix, serial_device_prefix, MAXPDSTRING-1);
|
||||||
|
test.serial_device_prefix[MAXPDSTRING-1] = 0;
|
||||||
#endif
|
#endif
|
||||||
test.baud = ibaud;
|
test.baud = ibaud;
|
||||||
test.data_bits = 8; /* default 8 data bits */
|
test.data_bits = 8; /* default 8 data bits */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue