* StrBufSanitizeEmailRecipientVector () fix another off by one
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 4 Oct 2010 22:14:33 +0000 (00:14 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 4 Oct 2010 22:14:33 +0000 (00:14 +0200)
libcitadel/lib/stringbuf.c
libcitadel/tests/email_recipientstrings.txt

index d6d960dabddcf3fc8db9cd960b549e5ace174872..98acba78284590723c04fbe738fb1be0e51a984a 100644 (file)
@@ -2649,7 +2649,6 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp,
                                pch = NULL;
                                if (EmailEnd != NULL) {
                                        gt = 1;
-                                       EmailEnd --;
                                }
                                else {
                                        EmailEnd = pche;
@@ -2675,7 +2674,11 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp,
                                EmailStart = strchr(UserStart, '<');
                                if ((EmailStart == NULL) || (EmailStart > EmailEnd))
                                        break;
-                               UserEnd = EmailStart - 1;
+                               UserEnd = EmailStart;
+
+                               while ((UserEnd > UserStart) && 
+                                      isspace (*(UserEnd - 1)))
+                                       UserEnd --;
                                EmailStart ++;
                                if (UserStart >= UserEnd)
                                        UserStart = UserEnd = NULL;
index 2d22ab098e2b72ee11e781c9d4526c27923e90ef..f7877dd91b7d30edd721ed1507abbc339622670a 100644 (file)
@@ -1,3 +1,4 @@
+Holger Müller<rss@localhost>
 "Alexandra Weiz, Restless GmbH" <alexandra.weiz@boblbee.de>, "NetIN" <editor@netin.co.il>, " יריב ברקאי, מולטימדי" <info@immembed.com>, "Завод ЖБ" <liderst@liderst.ru> 
 dothebart
 dothebart@uncensored.citadel.org