Skip to content

Commit 85cc9b8

Browse files
committed
C++: Use getClassAndName.
1 parent 9709c2f commit 85cc9b8

File tree

1 file changed

+2
-4
lines changed
  • cpp/ql/src/Security/CWE/CWE-611

1 file changed

+2
-4
lines changed

cpp/ql/src/Security/CWE/CWE-611/XXE.ql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ class CreateEntityReferenceNodesTranformer extends XXEFlowStateTranformer {
153153
CreateEntityReferenceNodesTranformer() {
154154
exists(Call call, Function f |
155155
call.getTarget() = f and
156-
f.getDeclaringType() instanceof AbstractDOMParserClass and
157-
f.hasName("setCreateEntityReferenceNodes") and
156+
f.getClassAndName("setCreateEntityReferenceNodes") instanceof AbstractDOMParserClass and
158157
this = call.getQualifier() and
159158
newValue = call.getArgument(0)
160159
)
@@ -195,8 +194,7 @@ class SetFeatureTranformer extends XXEFlowStateTranformer {
195194
SetFeatureTranformer() {
196195
exists(Call call, Function f |
197196
call.getTarget() = f and
198-
f.getDeclaringType() instanceof Sax2XmlReader and
199-
f.hasName("setFeature") and
197+
f.getClassAndName("setFeature") instanceof Sax2XmlReader and
200198
this = call.getQualifier() and
201199
globalValueNumber(call.getArgument(0)).getAnExpr().(VariableAccess).getTarget() instanceof
202200
FeatureDisableDefaultEntityResolution and

0 commit comments

Comments
 (0)