From 0fc0ed1bb1880014eb81073d3810c88a5e6acd92 Mon Sep 17 00:00:00 2001 From: He Chunhui Date: Wed, 16 Mar 2016 08:00:33 +0000 Subject: [PATCH] fix copy-paste bug This bug causes buffer overrun. --- components/net/lwip_nat/ipv4_nat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/net/lwip_nat/ipv4_nat.c b/components/net/lwip_nat/ipv4_nat.c index 6f218fc1e..a49a24612 100644 --- a/components/net/lwip_nat/ipv4_nat.c +++ b/components/net/lwip_nat/ipv4_nat.c @@ -370,12 +370,12 @@ ip_nat_reset_state(ip_nat_conf_t *cfg) } } for (i = 0; i < LWIP_NAT_DEFAULT_STATE_TABLES_TCP; i++) { - if(ip_nat_icmp_table[i].common.cfg == cfg) { + if(ip_nat_tcp_table[i].common.cfg == cfg) { IPNAT_ENTRY_RESET(&ip_nat_tcp_table[i].common); } } for (i = 0; i < LWIP_NAT_DEFAULT_STATE_TABLES_UDP; i++) { - if(ip_nat_icmp_table[i].common.cfg == cfg) { + if(ip_nat_udp_table[i].common.cfg == cfg) { IPNAT_ENTRY_RESET(&ip_nat_udp_table[i].common); } }