--- a/libpurple/plugins/keyrings/wincred.c Sat Jan 30 04:38:54 2021 -0600
+++ b/libpurple/plugins/keyrings/wincred.c Sat Jan 30 05:39:19 2021 -0600
@@ -203,7 +203,7 @@
memset(&credential, 0, sizeof(CREDENTIALW));
credential.Type = CRED_TYPE_GENERIC;
credential.TargetName = target_name;
- credential.CredentialBlobSize = purple_utf16_size(password_utf16) - 2;
+ credential.CredentialBlobSize = password_len * sizeof(gunichar2); credential.CredentialBlob = (LPBYTE)password_utf16;
credential.Persist = CRED_PERSIST_LOCAL_MACHINE;
credential.UserName = username_utf16;
--- a/libpurple/util.c Sat Jan 30 04:38:54 2021 -0600
+++ b/libpurple/util.c Sat Jan 30 05:39:19 2021 -0600
@@ -1167,23 +1167,6 @@
-purple_utf16_size(const gunichar2 *str)
- /* UTF16 cannot contain two consequent NUL bytes starting at even
- * position - see Unicode standards Chapter 3.9 D91 or RFC2781
- g_return_val_if_fail(str != NULL, 0);
- return i * sizeof(gunichar2);
purple_str_wipe(gchar *str)
@@ -1193,15 +1176,6 @@
-purple_utf16_wipe(gunichar2 *str)
- memset(str, 0, purple_utf16_size(str));
/**************************************************************************
**************************************************************************/
--- a/libpurple/util.h Sat Jan 30 04:38:54 2021 -0600
+++ b/libpurple/util.h Sat Jan 30 05:39:19 2021 -0600
@@ -734,16 +734,6 @@
char *purple_str_seconds_to_string(guint sec);
- * @str: String to check.
- * Calculates UTF-16 string size (in bytes).
- * Returns: Number of bytes (including NUL character) that string occupies.
-size_t purple_utf16_size(const gunichar2 *str);
* @str: A NUL-terminated string to free, or a NULL-pointer.
@@ -753,16 +743,6 @@
void purple_str_wipe(gchar *str);
- * @str: A NUL-terminated string to free, or a NULL-pointer.
- * Fills a NUL-terminated UTF-16 string with zeros and frees it.
- * It should be used to free sensitive data, like passwords.
-void purple_utf16_wipe(gunichar2 *str);
/**************************************************************************/
/**************************************************************************/