From 8180f9001678bb21332cf372889f5b7b4b1e3691 Mon Sep 17 00:00:00 2001 From: Florian Hoss Date: Fri, 29 Jul 2022 17:32:22 +0200 Subject: [PATCH] Fix update --- src/Firewall.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Firewall.cpp b/src/Firewall.cpp index f94012c..6cf0fe0 100644 --- a/src/Firewall.cpp +++ b/src/Firewall.cpp @@ -58,6 +58,8 @@ namespace fw firewall_rule_t *Firewall::update_rule_of_firewall(String *args, const uint8_t key) { firewall_rule_t *rule_ptr = get_rule_from_firewall(key); + if (rule_ptr == NULL) + return rule_ptr; strncpy(rule_ptr->ip, args[IP].c_str(), sizeof(rule_ptr->ip)); rule_ptr->port_from = args[PORT_FROM].toInt(); rule_ptr->port_to = args[PORT_TO].toInt();