From f29263777c79f8aa723bf0bccaaf79faa25c2da3 Mon Sep 17 00:00:00 2001 From: Loris Sierra Date: Tue, 7 Jan 2025 14:19:20 +0100 Subject: [PATCH] Modify S3649(Python): Fix logic error --- rules/S3649/python/how-to-fix-it/sqlalchemy.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/S3649/python/how-to-fix-it/sqlalchemy.adoc b/rules/S3649/python/how-to-fix-it/sqlalchemy.adoc index f839c894393..8fa14bfd944 100644 --- a/rules/S3649/python/how-to-fix-it/sqlalchemy.adoc +++ b/rules/S3649/python/how-to-fix-it/sqlalchemy.adoc @@ -27,7 +27,7 @@ import sqlalchemy @app.route('/example') def get_users(): user = request.args["user"] - conn = sqlalchemy.create_engine(connection_string) + engine = sqlalchemy.create_engine(connection_string) conn = engine.connect() conn.execute("SELECT user FROM users WHERE user = '" + user + "'") # Noncompliant @@ -43,7 +43,7 @@ import sqlalchemy @app.route('/example') def get_users(): user = request.args["user"] - conn = sqlalchemy.create_engine(connection_string) + engine = sqlalchemy.create_engine(connection_string) metadata = sqlalchemy.MetaData(bind=conn, reflect=True) users = metadata.tables['users'] conn = engine.connect()