mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-31 17:31:18 +01:00
native: Enforce safe strncpy usage in tap device setup
This commit is contained in:
parent
fd1a987bf1
commit
323a38819a
@ -300,7 +300,8 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
|
||||
|
||||
void netdev_tap_setup(netdev_tap_t *dev, const netdev_tap_params_t *params) {
|
||||
dev->netdev.driver = &netdev_driver_tap;
|
||||
strncpy(dev->tap_name, *(params->tap_name), IFNAMSIZ);
|
||||
strncpy(dev->tap_name, *(params->tap_name), IFNAMSIZ - 1);
|
||||
dev->tap_name[IFNAMSIZ - 1] = '\0';
|
||||
}
|
||||
|
||||
static void _tap_isr(int fd, void *arg) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user