* 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:43:36 +0000 (00:43 +0200)
libcitadel/lib/stringbuf.c
libcitadel/tests/email_recipientstrings.txt

index fcbd1daa74b8091d7a202637b03745f29cc0b739..5c538310feea86600e0f333423f56ea322e02d32 100644 (file)
@@ -2538,7 +2538,6 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp,
                                pch = NULL;
                                if (EmailEnd != NULL) {
                                        gt = 1;
-                                       EmailEnd --;
                                }
                                else {
                                        EmailEnd = pche;
@@ -2564,7 +2563,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 14d66c2615f88badaa9bf2a0897c293cc859b92b..3b8ba3d0b9b1e75edd856d3f5bc531efb34e440d 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