projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75913ba
)
* StrBufSanitizeEmailRecipientVector () fix null pointer accesses
author
Wilfried Göesgens
<willi@citadel.org>
Sat, 24 Jul 2010 10:30:45 +0000
(10:30 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Sat, 24 Jul 2010 10:30:45 +0000
(10:30 +0000)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index 861c1d2f991b10e06c42a4b17bf0b43fae67db83..250b3109c4b57f97fdbceac74ac6cae2e576cc0a 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-2582,19
+2582,24
@@
StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp,
}
}
}
}
-
- if (UserStart != NULL)
+ if ((UserStart != NULL) && (UserEnd != NULL))
+ StrBufPlain(UserName, UserStart, UserEnd - UserStart);
+ else if ((UserStart != NULL) && (UserEnd == NULL))
StrBufPlain(UserName, UserStart, UserEnd - UserStart);
else
FlushStrBuf(UserName);
StrBufPlain(UserName, UserStart, UserEnd - UserStart);
else
FlushStrBuf(UserName);
- if (EmailStart != NULL)
+
+ if ((EmailStart != NULL) && (EmailEnd != NULL))
StrBufPlain(EmailAddress, EmailStart, EmailEnd - EmailStart);
StrBufPlain(EmailAddress, EmailStart, EmailEnd - EmailStart);
+ else if ((EmailStart != NULL) && (EmailEnd == NULL))
+ StrBufPlain(EmailAddress, EmailStart, EmailEnd - pche);
else
FlushStrBuf(EmailAddress);
AddRecipient(Target, UserName, EmailAddress, EncBuf);
else
FlushStrBuf(EmailAddress);
AddRecipient(Target, UserName, EmailAddress, EncBuf);
-
+ if (pch == NULL)
+ break;
if ((pch != NULL) && (*pch == ','))
pch ++;
if ((pch != NULL) && (*pch == ','))
pch ++;