Merge "Firewall rule is invalid if target >= STC_FW_RULE_TARGET_MAX" into tizen
authorJaehyun Kim <jeik01.kim@samsung.com>
Tue, 20 Nov 2018 04:19:53 +0000 (04:19 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 20 Nov 2018 04:19:53 +0000 (04:19 +0000)
src/stc-firewall.c

index ec1f674..9f353ee 100644 (file)
@@ -1157,6 +1157,11 @@ gboolean __validate_fw_rule(firewall_rule_s *rule)
                return FALSE;
        }
 
+       if (rule->target >= STC_FW_RULE_TARGET_MAX) {
+               __STC_LOG_FUNC_EXIT__;
+               return FALSE;
+       }
+
        if (rule->target == STC_FW_RULE_TARGET_LOG &&
                (rule->log_prefix == NULL ||
                rule->log_prefix[0] == '\0')) {