From 1747bbb0cbc28e7eef2736af9cb75a58af67a776 Mon Sep 17 00:00:00 2001 From: Saumya Jain <70144862+saumyaj3@users.noreply.github.com> Date: Thu, 4 Jan 2024 14:18:57 +0100 Subject: [PATCH] Update cura_app.py sanitization of environment variable Co-authored-by: Casper Lamboo --- cura_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index 17321b8042..7e80bbac79 100755 --- a/cura_app.py +++ b/cura_app.py @@ -17,7 +17,11 @@ import faulthandler import os if sys.platform != "linux": # Turns out the Linux build _does_ use this, but we're not making an Enterprise release for that system anyway. os.environ["QT_PLUGIN_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. - os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. + try: + # try converting to integer + os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = str(int(os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"])) + except ValueError: + os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = "5000" os.environ["QML2_IMPORT_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. os.environ["QT_OPENGL_DLL"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul.