Do not fail miserably if not able to parse nginx conf

This commit is contained in:
Alexandre Aubin 2020-03-31 20:06:03 +02:00
parent 3399c15f73
commit 4a5d619ad1

View file

@ -240,7 +240,11 @@ class App():
if do_path_traversal_check: if do_path_traversal_check:
from lib.nginxparser import nginxparser from lib.nginxparser import nginxparser
try:
nginxconf = nginxparser.load(open(self.path + "/conf/" + filename)) nginxconf = nginxparser.load(open(self.path + "/conf/" + filename))
except Exception as e:
print_warning_not_reliable("Could not parse nginx conf ... : " + str(e))
nginxconf = []
for location in find_path_traversal_issue(nginxconf): for location in find_path_traversal_issue(nginxconf):
print_error( print_error(