Skip to content

Commit e78af3e

Browse files
committed
C#: Introduce Argument and Parameter index validation for models.
1 parent 37484a4 commit e78af3e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ module ModelValidation {
173173
or
174174
part = input.getToken(_) and
175175
parseParam(part, _)
176+
or
177+
invalidIndexComponent(input, part)
176178
) and
177179
result = "Unrecognized input specification \"" + part + "\" in " + pred + " model."
178180
)
@@ -184,9 +186,13 @@ module ModelValidation {
184186
or
185187
summaryModel(_, _, _, _, _, _, _, output, _, _) and pred = "summary"
186188
|
187-
invalidSpecComponent(output, part) and
188-
not part = "" and
189-
not (part = ["Argument", "Parameter"] and pred = "source") and
189+
(
190+
invalidSpecComponent(output, part) and
191+
not part = "" and
192+
not (part = ["Argument", "Parameter"] and pred = "source")
193+
or
194+
invalidIndexComponent(output, part)
195+
) and
190196
result = "Unrecognized output specification \"" + part + "\" in " + pred + " model."
191197
)
192198
}

0 commit comments

Comments
 (0)