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:
parent
1cc845b26c
commit
75a2ced795
@ -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];
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user