src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/injectionSql.py

branch
eric7
changeset 10169
0f70a4ef4592
parent 10069
435cc5875135
child 10439
21c28b0f9e41
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/injectionSql.py	Tue Aug 29 16:55:01 2023 +0200
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/injectionSql.py	Tue Aug 29 16:55:18 2023 +0200
@@ -62,7 +62,7 @@
     Function to analyze the given ast node.
 
     @param node ast node to be analyzed
-    @type ast.Str
+    @type ast.Constant
     @return tuple containing a flag indicating an execute call and
         the resulting statement
     @rtype tuple of (bool, str)
@@ -78,11 +78,11 @@
         isinstance(node._securityParent, ast.Attribute)
         and node._securityParent.attr == "format"
     ):
-        statement = node.s
+        statement = node.value
         # Hierarchy for "".format() is Wrapper -> Call -> Attribute -> Str
         wrapper = node._securityParent._securityParent._securityParent
     elif hasattr(ast, "JoinedStr") and isinstance(node._securityParent, ast.JoinedStr):
-        statement = node.s
+        statement = node.value
         wrapper = node._securityParent._securityParent
 
     if isinstance(wrapper, ast.Call):  # wrapped in "execute" call?

eric ide

mercurial