Merge pull request #1407 from devnsec-com/pr10

Fixes 2 lines of code that could cause IndexError in the nginx plugin
This commit is contained in:
Peter Eckersley 2015-11-07 09:11:25 -08:00
commit e653aa49f8

View file

@ -246,7 +246,7 @@ class NginxParser(object):
# Can't be a server block
return False
if item[0] == 'server_name':
if len(item) > 0 and item[0] == 'server_name':
server_names.update(_get_servernames(item[1]))
return server_names == names
@ -425,7 +425,7 @@ def _is_include_directive(entry):
"""
return (isinstance(entry, list) and
entry[0] == 'include' and len(entry) == 2 and
len(entry) == 2 and entry[0] == 'include' and
isinstance(entry[1], str))