* StrBufSanitizeEmailRecipientVector(): fix some NULL problems
authorWilfried Göesgens <willi@citadel.org>
Mon, 28 Jun 2010 18:59:08 +0000 (18:59 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 28 Jun 2010 18:59:08 +0000 (18:59 +0000)
libcitadel/lib/stringbuf.c

index f4a43c3031b61080300ba0ef01af242d4a582286..861c1d2f991b10e06c42a4b17bf0b43fae67db83 100644 (file)
@@ -2569,6 +2569,7 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp,
                                At = strchr(EmailStart, '@');
                        }
                        else { /* this is a local recipient... no domain, just a realname */
+                               EmailStart = UserStart;
                                At = strchr(EmailStart, '@');
                                if (At == NULL) {
                                        UserEnd = EmailEnd;
@@ -2595,9 +2596,9 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp,
 
 
                
-               if (*pch == ',')
+               if ((pch != NULL) && (*pch == ','))
                        pch ++;
-               while (isspace(*pch))
+               if (pch != NULL) while (isspace(*pch))
                        pch ++;
        }
        return Target;