Skip to content

Commit 9709c2f

Browse files
committed
C++: Use compliant PascalCase / make the checks happy.
1 parent 453dade commit 9709c2f

File tree

1 file changed

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

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ class XercesDOMParserClass extends Class {
6060
/**
6161
* The `SAXParser` class.
6262
*/
63-
class SAXParserClass extends Class {
64-
SAXParserClass() { this.hasName("SAXParser") }
63+
class SaxParserClass extends Class {
64+
SaxParserClass() { this.hasName("SAXParser") }
6565
}
6666

6767
/**
6868
* The `SAX2XMLReader` class.
6969
*/
70-
class SAX2XMLReader extends Class {
71-
SAX2XMLReader() { this.hasName("SAX2XMLReader") }
70+
class Sax2XmlReader extends Class {
71+
Sax2XmlReader() { this.hasName("SAX2XMLReader") }
7272
}
7373

7474
/**
@@ -120,7 +120,7 @@ class DisableDefaultEntityResolutionTranformer extends XXEFlowStateTranformer {
120120
call.getTarget() = f and
121121
(
122122
f.getDeclaringType() instanceof AbstractDOMParserClass or
123-
f.getDeclaringType() instanceof SAXParserClass
123+
f.getDeclaringType() instanceof SaxParserClass
124124
) and
125125
f.hasName("setDisableDefaultEntityResolution") and
126126
this = call.getQualifier() and
@@ -195,7 +195,7 @@ class SetFeatureTranformer extends XXEFlowStateTranformer {
195195
SetFeatureTranformer() {
196196
exists(Call call, Function f |
197197
call.getTarget() = f and
198-
f.getDeclaringType() instanceof SAX2XMLReader and
198+
f.getDeclaringType() instanceof Sax2XmlReader and
199199
f.hasName("setFeature") and
200200
this = call.getQualifier() and
201201
globalValueNumber(call.getArgument(0)).getAnExpr().(VariableAccess).getTarget() instanceof
@@ -225,8 +225,8 @@ class SetFeatureTranformer extends XXEFlowStateTranformer {
225225
class ParseFunction extends Function {
226226
ParseFunction() {
227227
this.getClassAndName("parse") instanceof AbstractDOMParserClass or
228-
this.getClassAndName("parse") instanceof SAXParserClass or
229-
this.getClassAndName("parse") instanceof SAX2XMLReader
228+
this.getClassAndName("parse") instanceof SaxParserClass or
229+
this.getClassAndName("parse") instanceof Sax2XmlReader
230230
}
231231
}
232232

@@ -245,10 +245,10 @@ class CreateLSParser extends Function {
245245
* The `createXMLReader` function that returns a newly created `SAX2XMLReader`
246246
* object.
247247
*/
248-
class CreateXMLReader extends Function {
249-
CreateXMLReader() {
248+
class CreateXmlReader extends Function {
249+
CreateXmlReader() {
250250
this.hasName("createXMLReader") and
251-
this.getUnspecifiedType().(PointerType).getBaseType() instanceof SAX2XMLReader // returns a `SAX2XMLReader *`.
251+
this.getUnspecifiedType().(PointerType).getBaseType() instanceof Sax2XmlReader // returns a `SAX2XMLReader *`.
252252
}
253253
}
254254

@@ -314,15 +314,15 @@ class XXEConfiguration extends DataFlow::Configuration {
314314
// source is the write on `this` of a call to the `SAXParser`
315315
// constructor.
316316
exists(CallInstruction call |
317-
call.getStaticCallTarget() = any(SAXParserClass c).getAConstructor() and
317+
call.getStaticCallTarget() = any(SaxParserClass c).getAConstructor() and
318318
node.asInstruction().(WriteSideEffectInstruction).getDestinationAddress() =
319319
call.getThisArgument() and
320320
encodeXercesFlowState(flowstate, 0, 1) // default configuration
321321
)
322322
or
323323
// source is the result of a call to `createXMLReader`.
324324
exists(Call call |
325-
call.getTarget() instanceof CreateXMLReader and
325+
call.getTarget() instanceof CreateXmlReader and
326326
call = node.asExpr() and
327327
encodeXercesFlowState(flowstate, 0, 1) // default configuration
328328
)

0 commit comments

Comments
 (0)