hartmannathan commented on code in PR #3295:
URL: https://github.com/apache/nuttx-apps/pull/3295#discussion_r2663059305


##########
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)

Review Comment:
   Just to make sure I understand correctly: If `args.table` is NULL, it's OK 
to call `iptables_apply()`? Note that in `iptables_apply()`, `COMMAND_FLUSH`, 
`COMMAND_LIST`, and `COMMAND_POLICY` will try to access `args->table`. It's 
possible other commands also will try, but I didn't dig further. If this was 
unintended, the line could be changed as follows, which will prevent calling 
`iptables_apply()` if `args.table` is NULL.
   ```suggestion
     if (args.table != NULL && strcmp(args.table, TABLE_NAME_NAT) == 0)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to