Blame SOURCES/0001-ipset-check-type-when-parsing-ipset-definition.patch

4d71d0
From 26e35f61bb856aa482f84f50521f924d4a6c12b1 Mon Sep 17 00:00:00 2001
4d71d0
From: Eric Garver <e@erig.me>
4d71d0
Date: Thu, 24 May 2018 16:30:13 -0400
4d71d0
Subject: [PATCH 1/5] ipset: check type when parsing ipset definition
4d71d0
4d71d0
(cherry picked from commit ebe0cb93c3f38a5d9af267407769eb187940c62f)
4d71d0
---
4d71d0
 src/firewall/core/io/ipset.py | 2 ++
4d71d0
 1 file changed, 2 insertions(+)
4d71d0
4d71d0
diff --git a/src/firewall/core/io/ipset.py b/src/firewall/core/io/ipset.py
4d71d0
index f291d15e0033..0670677b4206 100644
4d71d0
--- a/src/firewall/core/io/ipset.py
4d71d0
+++ b/src/firewall/core/io/ipset.py
4d71d0
@@ -320,6 +320,8 @@ class ipset_ContentHandler(IO_Object_ContentHandler):
4d71d0
         self.item.parser_check_element_attrs(name, attrs)
4d71d0
         if name == "ipset":
4d71d0
             if "type" in attrs:
4d71d0
+                if attrs["type"] not in IPSET_TYPES:
4d71d0
+                    raise FirewallError(errors.INVALID_TYPE, "%s" % attrs["type"])
4d71d0
                 self.item.type = attrs["type"]
4d71d0
             if "version" in attrs:
4d71d0
                 self.item.version = attrs["version"]
4d71d0
-- 
4d71d0
2.16.3
4d71d0