File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
swift/ql/lib/codeql/swift/frameworks/StandardLibrary Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ private import Numeric
20
20
private import PointerTypes
21
21
private import Sequence
22
22
private import Set
23
+ private import Stream
23
24
private import String
24
25
private import Url
25
26
private import UrlSession
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Provides models for `TextOutputStream` and related Swift classes.
3
+ */
4
+
5
+ import swift
6
+ private import codeql.swift.dataflow.ExternalFlow
7
+
8
+ /**
9
+ * A model for members of `TextOutputStream` and similar classes that permit taint flow.
10
+ */
11
+ private class StringSummaries extends SummaryModelCsv {
12
+ override predicate row ( string row ) {
13
+ row =
14
+ [
15
+ ";TextOutputStream;true;write(_:);;;Argument[0];Argument[-1];taint" ,
16
+ ";TextOutputStreamable;true;write(to:);;;Argument[-1];Argument[0];taint" ,
17
+ ]
18
+ }
19
+ }
Original file line number Diff line number Diff line change @@ -111,8 +111,6 @@ private class StringSummaries extends SummaryModelCsv {
111
111
";String;true;init(validatingPlatformString:);;;Argument[0].CollectionElement;ReturnValue.OptionalSome;taint" ,
112
112
";String;true;localizedStringWithFormat(_:_:);;;Argument[0];ReturnValue;taint" ,
113
113
";String;true;localizedStringWithFormat(_:_:);;;Argument[1].CollectionElement;ReturnValue;taint" ,
114
- ";String;true;write(_:);;;Argument[0];Argument[-1];taint" ,
115
- ";String;true;write(to:);;;Argument[-1];Argument[0];taint" ,
116
114
";String;true;insert(contentsOf:at:);;;Argument[0];Argument[-1];taint" ,
117
115
";String;true;replaceSubrange(_:with:);;;Argument[1];Argument[-1];taint" ,
118
116
";String;true;max();;;Argument[-1];ReturnValue;taint" ,
You can’t perform that action at this time.
0 commit comments