Skip to content

Commit c2194fe

Browse files
Fix CWE-73 found in PR #37
1 parent 2b8730a commit c2194fe

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

setup.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
def readFile(filename):
2929
"""Helper Function to read files"""
3030
theResult = None
31-
try:
32-
with open(str("""./{}""").format(str(filename))) as f:
33-
theResult = f.read()
34-
except Exception:
35-
theResult = str(
36-
"""See https://github.com/reactive-firewall/python-repo/{}"""
37-
).format(filename)
31+
if filename in ("""README.md""", """LICENSE.md"""):
32+
try:
33+
with open(str("""./{}""").format(str(filename))) as f:
34+
theResult = f.read()
35+
except Exception:
36+
theResult = str(
37+
"""See https://github.com/reactive-firewall/python-repo/{}"""
38+
).format(filename)
3839
return theResult
3940

4041

0 commit comments

Comments
 (0)