File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
python/ql/test/experimental/library-tests/frameworks/XML Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -45,3 +45,20 @@ def func(cond):
4545parser .setFeature (xml .sax .handler .feature_external_ges , True )
4646parser .setFeature (xml .sax .handler .feature_external_ges , False )
4747parser .parse (StringIO (x )) # $ input=StringIO(..) vuln='Billion Laughs' vuln='Quadratic Blowup'
48+
49+ def check_conditional_assignment (cond ):
50+ parser = xml .sax .make_parser ()
51+ if cond :
52+ parser .setFeature (xml .sax .handler .feature_external_ges , True )
53+ else :
54+ parser .setFeature (xml .sax .handler .feature_external_ges , False )
55+ parser .parse (StringIO (x )) # $ input=StringIO(..) vuln='Billion Laughs' vuln='DTD retrieval' vuln='Quadratic Blowup' vuln='XXE'
56+
57+ def check_conditional_assignment2 (cond ):
58+ parser = xml .sax .make_parser ()
59+ if cond :
60+ flag_value = True
61+ else :
62+ flag_value = False
63+ parser .setFeature (xml .sax .handler .feature_external_ges , flag_value )
64+ parser .parse (StringIO (x )) # $ input=StringIO(..) vuln='Billion Laughs' vuln='DTD retrieval' vuln='Quadratic Blowup' vuln='XXE'
You can’t perform that action at this time.
0 commit comments