Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06a2bcc

Browse files
committed
C#: Fix XmlReaderSettingsCreation logic
1 parent 5d8162c commit 06a2bcc

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • csharp/ql/src/semmle/code/csharp/frameworks/system

csharp/ql/src/semmle/code/csharp/frameworks/system/Xml.qll

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ class SystemXmlSchemaXmlSchemaValidationFlags extends EnumConstant {
138138
}
139139
}
140140

141+
private Expr getBitwiseOrOperand(Expr e) {
142+
result = e.(BitwiseOrExpr).getAnOperand()
143+
}
144+
141145
/** A creation of an instance of `System.Xml.XmlReaderSettings`. */
142146
class XmlReaderSettingsCreation extends ObjectCreation {
143147
XmlReaderSettingsCreation() {
@@ -157,10 +161,11 @@ class XmlReaderSettingsCreation extends ObjectCreation {
157161
/** Gets a value set for the given property in this local context. */
158162
private Expr getPropertyValue(Property p) {
159163
p = this.getType().(RefType).getAProperty() and
160-
exists(PropertyCall set |
164+
exists(PropertyCall set, Expr arg |
161165
set.getTarget() = p.getSetter() and
162166
DataFlow::localFlow(DataFlow::exprNode(this), DataFlow::exprNode(set.getQualifier())) and
163-
result = set.getAnArgument()
167+
arg = set.getAnArgument() and
168+
result = getBitwiseOrOperand*(arg)
164169
)
165170
}
166171
}

0 commit comments

Comments
 (0)