Skip to content

Commit 14c0bbf

Browse files
committed
Rust: Add another test case, fix an annotation.
1 parent 824aab8 commit 14c0bbf

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

rust/ql/test/query-tests/security/CWE-696/BadCTorInitialization.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| test.rs:69:9:69:24 | ...::stdin(...) | test.rs:66:1:66:7 | Attr | test.rs:69:9:69:24 | ...::stdin(...) | Call to ...::stdin(...) in a function with the ctor attribute. |
99
| test.rs:90:5:90:35 | ...::sleep(...) | test.rs:88:1:88:7 | Attr | test.rs:90:5:90:35 | ...::sleep(...) | Call to ...::sleep(...) in a function with the ctor attribute. |
1010
| test.rs:97:5:97:23 | ...::exit(...) | test.rs:95:1:95:7 | Attr | test.rs:97:5:97:23 | ...::exit(...) | Call to ...::exit(...) in a function with the ctor attribute. |
11-
| test.rs:166:5:166:15 | ...::stdout(...) | test.rs:164:1:164:7 | Attr | test.rs:166:5:166:15 | ...::stdout(...) | Call to ...::stdout(...) in a function with the ctor attribute. |
11+
| test.rs:171:5:171:15 | ...::stdout(...) | test.rs:169:1:169:7 | Attr | test.rs:171:5:171:15 | ...::stdout(...) | Call to ...::stdout(...) in a function with the ctor attribute. |
1212
edges
1313
| test.rs:29:1:29:13 | Attr | test.rs:31:9:31:25 | ...::stdout(...) |
1414
| test.rs:34:1:34:13 | Attr | test.rs:36:9:36:25 | ...::stdout(...) |
@@ -19,4 +19,4 @@ edges
1919
| test.rs:66:1:66:7 | Attr | test.rs:69:9:69:24 | ...::stdin(...) |
2020
| test.rs:88:1:88:7 | Attr | test.rs:90:5:90:35 | ...::sleep(...) |
2121
| test.rs:95:1:95:7 | Attr | test.rs:97:5:97:23 | ...::exit(...) |
22-
| test.rs:164:1:164:7 | Attr | test.rs:166:5:166:15 | ...::stdout(...) |
22+
| test.rs:169:1:169:7 | Attr | test.rs:171:5:171:15 | ...::stdout(...) |

rust/ql/test/query-tests/security/CWE-696/test.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ fn call_target3_2() {
137137
}
138138
}
139139

140-
#[ctor] // $ MISSING: Source=source3_2
140+
#[ctor]
141141
fn harmless3_2() {
142142
call_target3_2();
143143
}
144144

145-
#[ctor]
145+
#[ctor] // $ MISSING: Source=source3_3
146146
fn bad3_3() {
147147
call_target3_1();
148148
call_target3_2();
@@ -153,6 +153,11 @@ fn bad3_4() {
153153
bad3_3();
154154
}
155155

156+
fn harmless3_5() {
157+
call_target3_1();
158+
call_target3_2();
159+
}
160+
156161
// --- macros ---
157162

158163
macro_rules! macro4_1 {

0 commit comments

Comments
 (0)