retep998 / wio-rs

Windows things for Rust
Apache License 2.0
52 stars 14 forks source link

to_wide_null should return an error if the input contains any null characters #6

Open CodesInChaos opened 8 years ago

CodesInChaos commented 8 years ago

Change the result type of to_wide_null to Result<Vec<u16>, NulError>, matching CString::new.

Without this error you get silent truncation when passing data to an API which expects null terminated strings. This can easily result in security holes.