sspi-rs icon indicating copy to clipboard operation
sspi-rs copied to clipboard

Fix invalid wide strings (UTF-16) handling

Open TheBestTvarynka opened this issue 1 year ago • 1 comments

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.

TheBestTvarynka avatar Oct 15 '24 11:10 TheBestTvarynka

We could also consider using the widestring crate for a UTF-16 string type if necessary.

CBenoit avatar Jun 26 '25 12:06 CBenoit