From 8b534151d5f083e24fb723fe991861d157ad305e Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sun, 5 Jan 2014 18:05:37 +0200 Subject: [PATCH] ews: add additional check for new email address The specification says that we must check that the new email address is different from the one we are currently using. This obviously prevents an endless loop. --- src/core/sipe-ews-autodiscover.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/sipe-ews-autodiscover.c b/src/core/sipe-ews-autodiscover.c index a37b8121..ae29bd88 100644 --- a/src/core/sipe-ews-autodiscover.c +++ b/src/core/sipe-ews-autodiscover.c @@ -38,6 +38,7 @@ #include "sipe-core-private.h" #include "sipe-ews-autodiscover.h" #include "sipe-http.h" +#include "sipe-utils.h" #include "sipe-xml.h" struct sipe_ews_autodiscover_cb { @@ -128,10 +129,12 @@ static void sipe_ews_autodiscover_parse(struct sipe_core_private *sipe_private, /* * POX autodiscover redirect email address? * Make sure email address contains a "@" character. + * Make sure email address is different from current one. */ gchar *tmp = sipe_xml_data(sipe_xml_child(account, "RedirectAddr")); - if (tmp && strchr(tmp, '@')) { + if (tmp && strchr(tmp, '@') && + !sipe_strequal(sea->email, tmp)) { g_free(sea->email); sea->email = tmp; tmp = NULL; /* sea takes ownership */ -- 2.11.4.GIT