Skip to content

Commit a9e9289

Browse files
author
Evell Lam
committed
Catch all functions with execute
More generalized than only check session and cursor
1 parent ad2aea3 commit a9e9289

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

py_find_injection/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66

77
version_info = (0, 1, 1)
8-
__version__ = '0.1.1+dd.2'
8+
__version__ = '0.1.1+dd.3'
99

1010

1111
def stringify(node):
@@ -77,7 +77,7 @@ def check_execute(self, node):
7777

7878
def visit_Call(self, node):
7979
function_name = stringify(node.func)
80-
if function_name.lower() in ('session.execute', 'cursor.execute', 'conn.execute', 'trans.execute', 'pg.execute', 'db.execute'):
80+
if '.execute' in function_name.lower():
8181
try:
8282
node.args[0].parent = node
8383
node_error = self.check_execute(node.args[0])

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="py-find-injection",
6-
version="0.1.1+dd.2",
6+
version="0.1.1+dd.3",
77
author="James Brown",
88
author_email="jbrown@uber.com",
99
url="https://github.com/uber/py-find-injection",

0 commit comments

Comments
 (0)