mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-07 20:00:20 +00:00
red-stream-device: Fix "make syntax-check"
Avoid using strncpy, considered not secure. In this case a simple memcpy is used, we are going to terminate the string in any case on the next line. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Lukáš Hrázký <lhrazky@redhat.com>
This commit is contained in:
parent
3a58f08ca4
commit
70a724be6e
@ -330,9 +330,9 @@ handle_msg_device_display_info(StreamDevice *dev, SpiceCharDeviceInstance *sin)
|
||||
return true;
|
||||
}
|
||||
|
||||
strncpy(dev->device_display_info.device_address,
|
||||
(char*) display_info_msg->device_address,
|
||||
device_address_len);
|
||||
memcpy(dev->device_display_info.device_address,
|
||||
(char*) display_info_msg->device_address,
|
||||
device_address_len);
|
||||
|
||||
// make sure the string is terminated
|
||||
dev->device_display_info.device_address[device_address_len - 1] = '\0';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user