projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix possible crashes of not NULL-checking the result of icalproperty_get_attendee()
[citadel.git]
/
webcit
/
calendar.c
diff --git
a/webcit/calendar.c
b/webcit/calendar.c
index 6861a6a89f3286a5e53632eaca9fcff1c6533ea8..98fc8260c426eaa2ef052356f866b1555913c7f5 100644
(file)
--- a/
webcit/calendar.c
+++ b/
webcit/calendar.c
@@
-48,6
+48,7
@@
void cal_process_object(StrBuf *Target,
int is_update = 0;
char divname[32];
static int divcount = 0;
int is_update = 0;
char divname[32];
static int divcount = 0;
+ const char *ch;
sprintf(divname, "rsvp%04x", ++divcount);
sprintf(divname, "rsvp%04x", ++divcount);
@@
-182,11
+183,11
@@
void cal_process_object(StrBuf *Target,
StrBufAppendPrintf(Target, "<dt>");
StrBufAppendPrintf(Target, _("Attendee:"));
StrBufAppendPrintf(Target, "</dt><dd>");
StrBufAppendPrintf(Target, "<dt>");
StrBufAppendPrintf(Target, _("Attendee:"));
StrBufAppendPrintf(Target, "</dt><dd>");
-
safestrncpy(buf, icalproperty_get_attendee(p), sizeof buf
);
- if (!strncasecmp(buf, "MAILTO:", 7)) {
+
ch = icalproperty_get_attendee(p
);
+ if (
(ch != NULL) &&
!strncasecmp(buf, "MAILTO:", 7)) {
/** screen name or email address */
/** screen name or email address */
- s
trcpy(buf, &buf[7]
);
+ s
afestrncpy(buf, ch + 7, sizeof(buf)
);
striplt(buf);
StrEscAppend(Target, NULL, buf, 0, 0);
StrBufAppendPrintf(Target, " ");
striplt(buf);
StrEscAppend(Target, NULL, buf, 0, 0);
StrBufAppendPrintf(Target, " ");