sspi-rs
sspi-rs copied to clipboard
Fix invalid wide strings (UTF-16) handling
Usually, we multiply the chars count by 2 to calculate the total bytes in the wide string. For example, https://github.com/Devolutions/sspi-rs/blob/bef5fd24328871dbe9b6bbf3483bc84b8b9641ef/ffi/src/sspi/sec_winnt_auth_identity.rs#L323
Read this thread for more details: https://github.com/Devolutions/sspi-rs/pull/304#discussion_r1795097144
In the scope of this issue, we need to fix it.
We could also consider using the widestring crate for a UTF-16 string type if necessary.