Skip to content

Commit c3086d4

Browse files
committed
C++: Fix models and accept test changes.
1 parent 3abb904 commit c3086d4

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

cpp/ql/lib/ext/CPathT.model.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extensions:
33
pack: codeql/cpp-all
44
extensible: summaryModel
55
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
6-
- ["", "CPathT", True, "CPathT", "", "", "Argument[*1]", "Argument[-1]", "value", "manual"]
6+
- ["", "CPathT", True, "CPathT", "", "", "Argument[*0]", "Argument[-1]", "value", "manual"]
77
- ["", "CPathT", True, "AddExtension", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
88
- ["", "CPathT", True, "Append", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
99
- ["", "CPathT", True, "Combine", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
@@ -18,5 +18,6 @@ extensions:
1818
# - ["", "CPathT<T>", True, "operator const T&", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
1919
# - ["", "CPathT<T>", True, "operator T&", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
2020
- ["", "CPathT", True, "operator PCXSTR", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
21-
- ["", "CPathT", True, "operator +=", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
22-
- ["", "CPathT", True, "operator +=", "", "", "Argument[*0]", "ReturnValue[*]", "value", "manual"]
21+
- ["", "CPathT", True, "operator+=", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]
22+
- ["", "CPathT", True, "operator+=", "", "", "Argument[*0]", "ReturnValue[*]", "taint", "manual"]
23+
- ["", "CPathT", True, "operator+=", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]

cpp/ql/test/library-tests/dataflow/external-models/flow.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ edges
1111
| asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:103:29:103:39 | *send_buffer | provenance | Sink:MaD:6 |
1212
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | provenance | |
1313
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:10 |
14-
| test.cpp:4:5:4:11 | [summary param] 0 in ymlStep | test.cpp:4:5:4:11 | [summary] to write: ReturnValue in ymlStep | provenance | MaD:809 |
15-
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:7:10:7:18 | call to ymlSource | provenance | Src:MaD:807 |
16-
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:11:10:11:10 | x | provenance | Sink:MaD:808 |
14+
| test.cpp:4:5:4:11 | [summary param] 0 in ymlStep | test.cpp:4:5:4:11 | [summary] to write: ReturnValue in ymlStep | provenance | MaD:810 |
15+
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:7:10:7:18 | call to ymlSource | provenance | Src:MaD:808 |
16+
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:11:10:11:10 | x | provenance | Sink:MaD:809 |
1717
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:13:18:13:18 | x | provenance | |
1818
| test.cpp:13:10:13:16 | call to ymlStep | test.cpp:13:10:13:16 | call to ymlStep | provenance | |
19-
| test.cpp:13:10:13:16 | call to ymlStep | test.cpp:15:10:15:10 | y | provenance | Sink:MaD:808 |
19+
| test.cpp:13:10:13:16 | call to ymlStep | test.cpp:15:10:15:10 | y | provenance | Sink:MaD:809 |
2020
| test.cpp:13:18:13:18 | x | test.cpp:4:5:4:11 | [summary param] 0 in ymlStep | provenance | |
21-
| test.cpp:13:18:13:18 | x | test.cpp:13:10:13:16 | call to ymlStep | provenance | MaD:809 |
21+
| test.cpp:13:18:13:18 | x | test.cpp:13:10:13:16 | call to ymlStep | provenance | MaD:810 |
2222
nodes
2323
| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | semmle.label | [summary param] *0 in buffer |
2424
| asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | semmle.label | [summary] to write: ReturnValue in buffer |

cpp/ql/test/library-tests/dataflow/external-models/validatemodels.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
| Dubious member name "operator +=" in summary model. |
21
| Dubious member name "operator BSTR" in summary model. |
32
| Dubious member name "operator LPCSTR" in summary model. |
43
| Dubious member name "operator LPSAFEARRAY" in summary model. |

cpp/ql/test/library-tests/dataflow/taint-tests/atl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,11 @@ void test_CPathT() {
682682

683683
CPath p2;
684684
p2 += p;
685-
sink(p2.m_strPath); // $ MISSING: ir
685+
sink(p2.m_strPath); // $ MISSING: ir // this requires flow through `operator StringType&()` which we can't yet model in MaD
686686

687687
CPath p3;
688688
p3 += x;
689-
sink(p3.m_strPath); // $ MISSING: ir
689+
sink(p3.m_strPath); // $ ir
690690
}
691691

692692
{

0 commit comments

Comments
 (0)