1
0
mirror of https://github.com/simh/simh.git synced 2026-01-11 23:52:58 +00:00

SERIAL: Fix potential buffer overrun. (COVERITY)

This commit is contained in:
Mark Pizzolato 2017-03-10 09:19:15 -08:00
parent 1cc845b26c
commit 75a2ced795

View File

@ -188,7 +188,7 @@ serial_open_devices[serial_open_device_count-1].port = port;
serial_open_devices[serial_open_device_count-1].line = line;
strncpy(serial_open_devices[serial_open_device_count-1].name, name, sizeof(serial_open_devices[serial_open_device_count-1].name)-1);
if (config)
strncpy(serial_open_devices[serial_open_device_count-1].config, config, sizeof(serial_open_devices[serial_open_device_count-1].config));
strncpy(serial_open_devices[serial_open_device_count-1].config, config, sizeof(serial_open_devices[serial_open_device_count-1].config)-1);
return &serial_open_devices[serial_open_device_count-1];
}