[gnome-online-accounts/wip/mail: 3/6] exchange: Check for a '.' in the domain name of an email address



commit 1de52e78f1d213c3b2ea87183a18acf5c5de69c4
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 5 22:26:04 2013 +0100

    exchange: Check for a '.' in the domain name of an email address

 src/goabackend/goaexchangeprovider.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goaexchangeprovider.c b/src/goabackend/goaexchangeprovider.c
index 8e912cd..931eafe 100644
--- a/src/goabackend/goaexchangeprovider.c
+++ b/src/goabackend/goaexchangeprovider.c
@@ -420,6 +420,7 @@ static gboolean
 is_valid_email_address (const gchar *email, gchar **out_username, gchar **out_domain)
 {
   gchar *at;
+  gchar *dot;
 
   if (email == NULL || email[0] == '\0')
     return FALSE;
@@ -428,6 +429,10 @@ is_valid_email_address (const gchar *email, gchar **out_username, gchar **out_do
   if (at == NULL || *(at + 1) == '\0')
     return FALSE;
 
+  dot = strchr (at + 1, '.');
+  if (dot == NULL || *(dot + 1) == '\0')
+    return FALSE;
+
   if (out_username != NULL)
     {
       *out_username = g_strdup (email);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]