* Fixes NB#91689. fixes a wrong check for ASCII
[modest] / src / modest-account-mgr-helpers.c
index 3a23316..0d8245b 100644 (file)
@@ -33,6 +33,7 @@
 #include <modest-runtime.h>
 #include <modest-defs.h>
 #include <string.h>
+#include <strings.h>
 
 static const gchar * null_means_empty (const gchar * str);
 
@@ -321,8 +322,11 @@ modest_account_mgr_get_server_account_has_password (ModestAccountMgr *self, cons
                TRUE /* server account */);
        if (password && strlen (password)) {
                result = TRUE;
-       }
        
+               /* Clean password */
+               bzero (password, strlen (password));
+       }
+
        g_free (password);
        return result;
 }
@@ -814,6 +818,8 @@ modest_account_mgr_get_from_string (ModestAccountMgr *self, const gchar* name)
 static gchar*
 util_increment_name (const gchar* text)
 {
+       g_return_val_if_fail (text, NULL);
+
        /* Get the end character,
         * also doing a UTF-8 validation which is required for using g_utf8_prev_char().
         */
@@ -838,7 +844,7 @@ util_increment_name (const gchar* text)
                        break;
                }
                
-               p = g_utf8_prev_char (p);       
+               p = g_utf8_find_prev_char (text, p);    
        }
        
        if(!alpha_end) {