Bugfix - Constant init var fixed
parent
012581e641
commit
c75f1eb415
|
@ -99,11 +99,12 @@ def check_declaration(content, vuln, path):
|
|||
declaration = regex_declaration.findall(content)
|
||||
if len(declaration)>0:
|
||||
|
||||
# TODO: Check constant then return True if constant because it's false positive
|
||||
# Check constant then return True if constant because it's false positive
|
||||
declaration_text = "$"+vuln[1:] +declaration[0][0]+"="+declaration[0][1]
|
||||
line_declaration = find_line_declaration(declaration_text, content)
|
||||
regex_constant = re.compile("\$"+vuln[1:]+"([\t ]*)=[\t ]*([\"\'][a-zA-Z0-9]*?[\"\']);")
|
||||
regex_constant = re.compile("\$"+vuln[1:]+"([\t ]*)=[\t ]*([\"\'(]*?[a-zA-Z0-9{}_]*?[\"\')]*?);")
|
||||
false_positive = regex_constant.match(declaration_text)
|
||||
|
||||
if false_positive:
|
||||
return (True, "","")
|
||||
return (False, declaration_text,line_declaration)
|
||||
|
|
Loading…
Reference in New Issue