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 06fa510..fb4a360 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