Blame SOURCES/0066-fix-rich-limit-table-to-strip-non-printables-to-C0-a.patch

00d018
From ff6e65737413d54b6f6964f72827a92fdbecc182 Mon Sep 17 00:00:00 2001
00d018
From: Eric Garver <eric@garver.life>
00d018
Date: Fri, 8 Jan 2021 13:38:15 -0500
00d018
Subject: [PATCH 68/68] fix(rich): limit table to strip non-printables to C0
00d018
 and C1
00d018
00d018
Generating the table was taking an unreasonable amount of memory.
00d018
Stripping C0 and C1 should cover most scenarios while limiting memory
00d018
usage.
00d018
00d018
Fixes: ac5960856991 ("fix(rich): non-printable characters removed from rich rules")
00d018
(cherry picked from commit 015704b44f81d535a868fe28368f977cefd28638)
00d018
(cherry picked from commit 629a53ef027146f8e4e486c40c8bde04cda830d3)
00d018
---
00d018
 src/firewall/functions.py | 7 ++++++-
00d018
 1 file changed, 6 insertions(+), 1 deletion(-)
00d018
00d018
diff --git a/src/firewall/functions.py b/src/firewall/functions.py
00d018
index d20b702e047e..1ea9f4309234 100644
00d018
--- a/src/firewall/functions.py
00d018
+++ b/src/firewall/functions.py
00d018
@@ -43,7 +43,12 @@ from firewall.config import FIREWALLD_TEMPDIR, FIREWALLD_PIDFILE
00d018
 PY2 = sys.version < '3'
00d018
 
00d018
 NOPRINT_TRANS_TABLE = {
00d018
-    i: None for i in range(0, sys.maxunicode + 1) if not chr(i).isprintable()
00d018
+    # Limit to C0 and C1 code points. Building entries for all unicode code
00d018
+    # points requires too much memory.
00d018
+    # C0 = [0, 31]
00d018
+    # C1 = [127, 159]
00d018
+    #
00d018
+    i: None for i in range(0, 160) if not (i > 31 and i < 127)
00d018
 }
00d018
 
00d018
 def getPortID(port):
00d018
-- 
00d018
2.27.0
00d018