Skip to content

Commit 3d0a205

Browse files
committed
C++: Fix 'BSTRToArray' stub and MaD model.
1 parent 66de42c commit 3d0a205

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extensions:
2020
- ["", "CComBSTR", True, "ArrayToBSTR", "", "", "Argument[*0].Field[*pvData]", "Argument[-1]", "value", "manual"]
2121
- ["", "CComBSTR", True, "AssignBSTR", "", "", "Argument[*0]", "Argument[-1]", "value", "manual"]
2222
- ["", "CComBSTR", True, "Attach", "", "", "Argument[*0]", "Argument[-1]", "value", "manual"]
23-
- ["", "CComBSTR", True, "BSTRToArray", "", "", "Argument[-1]", "Argument[*0].Field[*pvData]", "value", "manual"]
23+
- ["", "CComBSTR", True, "BSTRToArray", "", "", "Argument[-1]", "Argument[**0].Field[*pvData]", "value", "manual"]
2424
- ["", "CComBSTR", True, "Copy", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
2525
- ["", "CComBSTR", True, "CopyTo", "", "", "Argument[-1]", "Argument[*0]", "value", "manual"]
2626
- ["", "CComBSTR", True, "LoadString", "(HINSTANCE,UINT)", "", "Argument[1]", "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:801 |
15-
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:7:10:7:18 | call to ymlSource | provenance | Src:MaD:799 |
16-
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:11:10:11:10 | x | provenance | Sink:MaD:800 |
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:800 |
15+
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:7:10:7:18 | call to ymlSource | provenance | Src:MaD:798 |
16+
| test.cpp:7:10:7:18 | call to ymlSource | test.cpp:11:10:11:10 | x | provenance | Sink:MaD:799 |
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:800 |
19+
| test.cpp:13:10:13:16 | call to ymlStep | test.cpp:15:10:15:10 | y | provenance | Sink:MaD:799 |
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:801 |
21+
| test.cpp:13:18:13:18 | x | test.cpp:13:10:13:16 | call to ymlStep | provenance | MaD:800 |
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/taint-tests/atl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ struct CComBSTR {
426426
HRESULT ArrayToBSTR(const SAFEARRAY* pSrc) throw();
427427
HRESULT AssignBSTR(const BSTR bstrSrc) throw();
428428
void Attach(BSTR src) throw();
429-
HRESULT BSTRToArray(LPSAFEARRAY ppArray) throw();
429+
HRESULT BSTRToArray(LPSAFEARRAY* ppArray) throw();
430430
unsigned int ByteLength() const throw();
431431
BSTR Copy() const throw();
432432
HRESULT CopyTo(BSTR* pbstr) throw();
@@ -504,10 +504,10 @@ void test_CComBSTR() {
504504
sink(b8.m_str); // $ ir
505505

506506
CComBSTR b9;
507-
SAFEARRAY safe;
507+
LPSAFEARRAY safe;
508508
b9.Append(source<char>());
509509
b9.BSTRToArray(&safe);
510-
sink(safe.pvData); // $ ir
510+
sink(safe->pvData); // $ ir
511511

512512
sink(b9.Copy()); // $ ir
513513
}

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future
606606
| atl.cpp:506:14:506:15 | call to CComBSTR | atl.cpp:509:5:509:6 | b9 | |
607607
| atl.cpp:506:14:506:15 | call to CComBSTR | atl.cpp:512:10:512:11 | b9 | |
608608
| atl.cpp:506:14:506:15 | call to CComBSTR | atl.cpp:513:3:513:3 | b9 | |
609-
| atl.cpp:507:15:507:18 | safe | atl.cpp:509:21:509:24 | safe | |
610-
| atl.cpp:507:15:507:18 | safe | atl.cpp:510:10:510:13 | safe | |
609+
| atl.cpp:507:17:507:20 | safe | atl.cpp:509:21:509:24 | safe | |
610+
| atl.cpp:507:17:507:20 | safe | atl.cpp:510:10:510:13 | safe | |
611611
| atl.cpp:508:5:508:6 | ref arg b9 | atl.cpp:509:5:509:6 | b9 | |
612612
| atl.cpp:508:5:508:6 | ref arg b9 | atl.cpp:512:10:512:11 | b9 | |
613613
| atl.cpp:508:5:508:6 | ref arg b9 | atl.cpp:513:3:513:3 | b9 | |

cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ getParameterTypeName
613613
| atl.cpp:426:11:426:21 | ArrayToBSTR | 0 | const SAFEARRAY * |
614614
| atl.cpp:427:11:427:20 | AssignBSTR | 0 | const BSTR |
615615
| atl.cpp:428:8:428:13 | Attach | 0 | BSTR |
616-
| atl.cpp:429:11:429:21 | BSTRToArray | 0 | LPSAFEARRAY |
616+
| atl.cpp:429:11:429:21 | BSTRToArray | 0 | LPSAFEARRAY * |
617617
| atl.cpp:432:11:432:16 | CopyTo | 0 | BSTR * |
618618
| atl.cpp:434:11:434:16 | CopyTo | 0 | VARIANT * |
619619
| atl.cpp:438:8:438:17 | LoadString | 0 | HINSTANCE |

0 commit comments

Comments
 (0)