Rust: address review

Also fix some minor things in `bulk_generate_mad.py`.
This commit is contained in:
Paolo Tranquilli
2025-06-05 16:02:29 +02:00
parent 6162cf5dbb
commit e1eb1f6345
4 changed files with 31 additions and 29 deletions

View File

@@ -1,6 +1,12 @@
strategy: dca
language: rust
destination: rust/ql/lib/ext/generated
# targets must have name specified and corresponding to the name in the DCA suite
# they can optionally specify any of
# with-sinks: false
# with-sources: false
# with-summaries: false
# if a target has a dependency in this same list, it should be listed after that dependency
targets:
- name: rust
- name: libc

View File

@@ -526,3 +526,4 @@ nodes
subpaths
testFailures
| main.rs:202:32:202:38 | realloc | Unexpected result: Alert=arg1 |
| main.rs:202:52:202:96 | //... | Missing result: Alert[rust/uncontrolled-allocation-size] |

View File

@@ -199,7 +199,7 @@ unsafe fn test_system_alloc(v: usize) {
let l3 = std::alloc::Layout::array::<u8>(10).unwrap();
let m3 = std::alloc::System.alloc(l3);
let _ = std::alloc::System.realloc(m3, l3, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size]
let _ = std::alloc::System.realloc(m3, l3, v); // $ Alert[rust/uncontrolled-allocation-size]
let l4 = std::alloc::Layout::array::<u8>(10).unwrap();
let m4 = std::ptr::NonNull::<u8>::new(std::alloc::alloc(l4)).unwrap();