mirror of
https://github.com/simh/simh.git
synced 2026-04-13 23:44:44 +00:00
SERIAL: Fix potential buffer overrun. (COVERITY)
This commit is contained in:
@@ -188,7 +188,7 @@ serial_open_devices[serial_open_device_count-1].port = port;
|
|||||||
serial_open_devices[serial_open_device_count-1].line = line;
|
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);
|
strncpy(serial_open_devices[serial_open_device_count-1].name, name, sizeof(serial_open_devices[serial_open_device_count-1].name)-1);
|
||||||
if (config)
|
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];
|
return &serial_open_devices[serial_open_device_count-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user