From: Johannes Schmid Date: Sat, 4 Aug 2007 14:15:36 +0000 (+0000) Subject: 2007-08-04 Johannes Schmid X-Git-Tag: git_migration_finished~2627 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=92bef44ea70f8b4e16c78591bc12f58fac9a7c53;hp=888cdd23c6c1b1a81218e9067fe0f9a9b340e66e 2007-08-04 Johannes Schmid * 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 --- diff --git a/ChangeLog2 b/ChangeLog2 index bf3ba61..934bd57 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,3 +1,11 @@ +2007-08-04 Johannes Schmid + + * 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 * src/modest-account-mgr-helpers.h: diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index d674686..51e340e 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -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; - + + /* 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 == '\"' &&