Update rust/ql/test/query-tests/security/CWE-770/main.rs

Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
Paolo Tranquilli
2025-06-10 10:52:18 +02:00
committed by GitHub
parent d6d13b9164
commit e6056f9dfc

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); // $ Alert[rust/uncontrolled-allocation-size]
let _ = std::alloc::System.realloc(m3, l3, v); // $ Alert[rust/uncontrolled-allocation-size]=arg1
let l4 = std::alloc::Layout::array::<u8>(10).unwrap();
let m4 = std::ptr::NonNull::<u8>::new(std::alloc::alloc(l4)).unwrap();