diff options
| author | Evlers <[email protected]> | 2026-05-22 16:52:13 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-05-24 12:06:38 +0800 |
| commit | c191ad8cd4042e6ab3fec71524797ad6e2e711ce (patch) | |
| tree | 9333aa881b76e402f8e6d84b2fa07e723c268180 /components | |
| parent | 047ab1eca44e88200de407ddf4347bf0ce175106 (diff) | |
[lwip][ppp]: fix the risk of name member contamination in the ppp netif
Diffstat (limited to 'components')
| -rw-r--r-- | components/net/lwip/Kconfig | 1 | ||||
| -rw-r--r-- | components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/components/net/lwip/Kconfig b/components/net/lwip/Kconfig index fe019a3f72..374f4d565f 100644 --- a/components/net/lwip/Kconfig +++ b/components/net/lwip/Kconfig @@ -213,6 +213,7 @@ if RT_USING_LWIP config RT_LWIP_NETIF_NAMESIZE int "netif name length" default 6 + range 3 32 config SO_REUSE int "Enable SO_REUSEADDR option" diff --git a/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c b/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c index 298bbc150e..1b9f0d1116 100644 --- a/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c +++ b/components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c @@ -469,8 +469,7 @@ static void ppp_do_connect(void *arg) { * ppp_netif_init_cb - netif init callback */ static err_t ppp_netif_init_cb(struct netif *netif) { - netif->name[0] = 'p'; - netif->name[1] = 'p'; + strncpy(netif->name, "pp", sizeof(netif->name)); #if PPP_IPV4_SUPPORT netif->output = ppp_netif_output_ip4; #endif /* PPP_IPV4_SUPPORT */ |
