Skip to content

Commit be9c1d0

Browse files
authored
Merge pull request #21376 from geoffw0/splitoff2
Rust: Update split_off models
2 parents 8bbb0ec + d81b9aa commit be9c1d0

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,14 @@ extensions:
5555
- ["<alloc::string::String as core::ops::arith::Add>::add", "Argument[0].Reference", "ReturnValue", "taint", "manual"]
5656
# Vec
5757
- ["alloc::vec::from_elem", "Argument[0]", "ReturnValue.Element", "value", "manual"]
58-
- ["<alloc::vec::Vec as core::ops::deref::Deref>::deref", "Argument[self].Reference.Element", "ReturnValue.Reference.Element", "value", "manual"]
58+
- ["<alloc::vec::Vec as core::ops::deref::Deref>::deref", "Argument[self].Reference.Element", "ReturnValue.Reference.Element", "value", "manual"]
59+
- addsTo:
60+
pack: codeql/rust-all
61+
extensible: neutralModel
62+
data:
63+
- ["<alloc::vec::Vec as core::convert::From>::from", "sink", "manual"]
64+
- ["<alloc::collections::vec_deque::VecDeque as core::convert::From>::from", "sink", "manual"]
65+
- ["<alloc::sync::Arc as core::convert::From>::from", "sink", "manual"]
66+
- ["<alloc::rc::Rc as core::convert::From>::from", "sink", "manual"]
67+
- ["<alloc::string::String>::split_off", "sink", "manual"]
68+
- ["<alloc::vec::Vec>::split_off", "sink", "manual"]

rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,7 @@ extensions:
165165
extensible: neutralModel
166166
data:
167167
- ["<core::option::Option>::map", "sink", "manual"]
168-
- ["<alloc::vec::Vec as core::convert::From>::from", "sink", "manual"]
169-
- ["<alloc::collections::vec_deque::VecDeque as core::convert::From>::from", "sink", "manual"]
170168
- ["<std::io::error::Error as core::convert::From>::from", "sink", "manual"]
171-
- ["<alloc::sync::Arc as core::convert::From>::from", "sink", "manual"]
172-
- ["<alloc::rc::Rc as core::convert::From>::from", "sink", "manual"]
173169
- addsTo:
174170
pack: codeql/rust-all
175171
extensible: excludeFieldTaintStep

rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,4 @@ module UncontrolledAllocationSize {
6363
branch = false
6464
)
6565
}
66-
67-
/**
68-
* A barrier for uncontrolled allocation size flow into particular functions.
69-
*/
70-
private class ModeledBarrier extends Barrier {
71-
ModeledBarrier() {
72-
exists(MethodCall c |
73-
c.getStaticTarget().getCanonicalPath() =
74-
["<alloc::string::String>::split_off", "<alloc::vec::Vec>::split_off"] and
75-
this.asExpr() = c.getAnArgument()
76-
)
77-
}
78-
}
7966
}

0 commit comments

Comments
 (0)