]> git.ipfire.org Git - thirdparty/suricata.git/commit
rust: return empty slice without using from_raw_parts
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 23 May 2024 12:05:08 +0000 (14:05 +0200)
committerPhilippe Antoine <pantoine@oisf.net>
Thu, 23 May 2024 20:14:00 +0000 (22:14 +0200)
commit65733e2a93a7ac44c0a35724bf14a480703f5fcb
tree0ff90914da2e51dd16135300e0da1373f6dbe815
parent7e6dbcd851e14f2e59c74e742dd5c81b2cbcbc70
rust: return empty slice without using from_raw_parts

As this triggers rustc 1.78
unsafe precondition(s) violated: slice::from_raw_parts requires
the pointer to be aligned and non-null,
and the total size of the slice not to exceed `isize::MAX`

Ticket: 7013
inspired from commit 5dc8dea8695786daec491a6655f99c0791e47f5c
rust/src/applayer.rs
rust/src/nfs/nfs.rs
rust/src/smb/smb.rs