From 53e8c3796557fb7e0078a31f398cbea2ad53900c Mon Sep 17 00:00:00 2001 From: "patched.codes[bot]" <298395+patched.codes[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 18:38:01 +0000 Subject: [PATCH] Patched /tmp/tmpizwbfryv/index.py --- index.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.py b/index.py index 83759b9..5a87875 100644 --- a/index.py +++ b/index.py @@ -7,12 +7,11 @@ } def get_data_by_config_value(value): - # This might look suspicious due to string concatenation with values from CONFIG. - query = "SELECT * FROM " + CONFIG["default_table"] + " WHERE " + CONFIG["default_column"] + " = '" + value + "'" + query = "SELECT * FROM {} WHERE {} = ?".format(CONFIG["default_table"], CONFIG["default_column"]) connection = sqlite3.connect("database.db") cursor = connection.cursor() - cursor.execute(query) + cursor.execute(query, (value,)) result = cursor.fetchall() connection.close()