]> git.ipfire.org Git - people/ms/suricata.git/commit
rust: remove all usage of transmute
authorJason Ish <jason.ish@oisf.net>
Mon, 26 Jul 2021 19:25:17 +0000 (13:25 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 23 Aug 2021 08:03:12 +0000 (10:03 +0200)
commit53413f2d7af513f631fcae316a5ea2142d94e977
tree657152c94cce793f807d772cab3cff3496203b37
parentcbd03c7ea4c5a74d724b10bf65dbbc2082e061d6
rust: remove all usage of transmute

All cases of our transmute can be replaced with more idiomatic
solutions and do no require the power of transmute.

When returning an object to C for life-time management, use
Box::into_raw to convert the boxed object to pointer and use
Box::from_raw to convert back.

For cases where we're just returning a pointer to Rust managed
data, use a cast.
22 files changed:
rust/src/applayertemplate/template.rs
rust/src/dcerpc/dcerpc.rs
rust/src/dcerpc/dcerpc_udp.rs
rust/src/dcerpc/detect.rs
rust/src/dhcp/dhcp.rs
rust/src/dhcp/logger.rs
rust/src/dns/detect.rs
rust/src/dns/dns.rs
rust/src/http2/detect.rs
rust/src/http2/http2.rs
rust/src/ike/ike.rs
rust/src/krb/krb5.rs
rust/src/mqtt/mqtt.rs
rust/src/nfs/nfs.rs
rust/src/ntp/ntp.rs
rust/src/rdp/rdp.rs
rust/src/rfb/rfb.rs
rust/src/sip/sip.rs
rust/src/smb/smb.rs
rust/src/snmp/snmp.rs
rust/src/ssh/ssh.rs
rust/src/tftp/tftp.rs