Fix uninitialized values in sieve privacy prefs parsing.
authorAndrej Kacian <ticho@claws-mail.org>
Mon, 10 Jul 2017 16:36:37 +0000 (18:36 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Mon, 10 Jul 2017 16:36:37 +0000 (18:36 +0200)
This happens if username and/or password fields are empty,
so sscanf() doesn't get to write into our enc_userid and
enc_passwd buffers.

src/plugins/managesieve/sieve_prefs.c

index 06fa5100dae174869e960cdac6171d4ea8f677fb..fb4a360c726a3d51234515ea23cca4d31bac7114 100644 (file)
@@ -503,6 +503,8 @@ struct SieveAccountConfig *sieve_prefs_account_get_config(
        if (confstr == NULL)
                return config;
 
+       enc_userid[0] = '\0';
+       enc_passwd[0] = '\0';
 #if defined(G_OS_WIN32) || defined(__OpenBSD__)
        sscanf(confstr, "%c%c %255s %c%hu %hhu %hhu %hhu %255s %255s",
 #else