2007-08-04 Johannes Schmid <johannes.schmid@openismus.com>
authorJohannes Schmid <johannes.schmid@openismus.com>
Sat, 4 Aug 2007 14:15:36 +0000 (14:15 +0000)
committerJohannes Schmid <johannes.schmid@openismus.com>
Sat, 4 Aug 2007 14:15:36 +0000 (14:15 +0000)
* src/modest-text-utils.c:
Fixed invalid jump due to incorrect string/pointer
operation.
(See https://projects.maemo.org/trac/email/wiki/ValgrindErrors
for details)

pmo-trunk-r2934

ChangeLog2
src/modest-text-utils.c

index bf3ba61..934bd57 100644 (file)
@@ -1,3 +1,11 @@
+2007-08-04  Johannes Schmid <johannes.schmid@openismus.com>
+
+       * src/modest-text-utils.c:
+       Fixed invalid jump due to incorrect string/pointer
+       operation. 
+       (See https://projects.maemo.org/trac/email/wiki/ValgrindErrors
+       for details)
+
 2007-08-01  Murray Cumming  <murrayc@murrayc.com>
 
        * src/modest-account-mgr-helpers.h:
 2007-08-01  Murray Cumming  <murrayc@murrayc.com>
 
        * src/modest-account-mgr-helpers.h:
index d674686..51e340e 100644 (file)
@@ -1157,7 +1157,14 @@ modest_text_utils_validate_email_address (const gchar *email_address, const gcha
 
        if (invalid_char_position != NULL)
                *invalid_char_position = NULL;
 
        if (invalid_char_position != NULL)
                *invalid_char_position = NULL;
-
+       
+       /* check that the email adress contains exactly one @ */
+       if (!strstr(email_address, "@") || 
+                       (strstr(email_address, "@") != g_strrstr(email_address, "@")))
+       {
+               return FALSE;
+       }
+       
        /* first we validate the name portion (name@domain) */
        for (c = email_address;  *c;  c++) {
                if (*c == '\"' && 
        /* first we validate the name portion (name@domain) */
        for (c = email_address;  *c;  c++) {
                if (*c == '\"' &&