This is an automated email from the ASF dual-hosted git repository.
linguini pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 7daac30cb system/iptables: avoid trap when running "iptables -L"
7daac30cb is described below
commit 7daac30cb47d5192f517a4c8e98d70d4e9937df7
Author: shichunma <[email protected]>
AuthorDate: Thu Jan 1 09:46:57 2026 +0800
system/iptables: avoid trap when running "iptables -L"
A trap occurs every time CONFIG_NET_NAT is enabled while
CONFIG_NET_IPFILTER is not.
Signed-off-by: Jerry Ma <[email protected]>
---
system/iptables/iptables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/iptables/iptables.c b/system/iptables/iptables.c
index 7072ed968..673559634 100644
--- a/system/iptables/iptables.c
+++ b/system/iptables/iptables.c
@@ -506,7 +506,7 @@ int main(int argc, FAR char *argv[])
else
#endif
#ifdef CONFIG_NET_NAT
- if (strcmp(args.table, TABLE_NAME_NAT) == 0)
+ if (args.table != NULL && strcmp(args.table, TABLE_NAME_NAT) == 0)
{
ret = iptables_apply(&args, iptables_nat_command);
if (ret < 0)