Fix potential crash in vcalendar's icalcomponent_vanew() on 64-bit archs.

We need to pass the terminating zero cast to void*,
because size of void* is 8 bytes, while size of a
literal 0 just 4 bytes. The arguments are retrieved
as void*, so without this void* cast, we're taking
four extra bytes belonging to whatever data is
stored in memory directly after our four-byte zero.
This commit is contained in:
Andrej Kacian 2016-08-15 13:32:41 +02:00
parent dd7568a78b
commit d20742effa
3 changed files with 8 additions and 8 deletions

View file

@ -2111,7 +2111,7 @@ gchar *vcal_get_event_as_ical_str(VCalEvent *event)
icalproperty_new_prodid(
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
0);
(void*)0);
vcal_manager_event_dump(event, FALSE, FALSE, calendar, FALSE);
ical = g_strdup(icalcomponent_as_ical_string(calendar));
icalcomponent_free(calendar);

View file

@ -347,7 +347,7 @@ gchar *vcal_manager_event_dump(VCalEvent *event, gboolean is_reply, gboolean is_
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
icalproperty_new_method(is_reply ? ICAL_METHOD_REPLY:event->method),
0
(void*)0
);
if (!calendar) {
@ -380,7 +380,7 @@ gchar *vcal_manager_event_dump(VCalEvent *event, gboolean is_reply, gboolean is_
ievent =
icalcomponent_vanew(
ICAL_VEVENT_COMPONENT, 0);
ICAL_VEVENT_COMPONENT, (void*)0);
if (!ievent) {
g_warning ("can't generate event");
@ -700,7 +700,7 @@ gchar *vcal_manager_icalevent_dump(icalcomponent *event, gchar *orga, icalcompon
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
icalproperty_new_method(ICAL_METHOD_PUBLISH),
0
(void*)0
);
if (!calendar) {

View file

@ -1974,7 +1974,7 @@ void multisync_export(void)
icalproperty_new_prodid(
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
0
(void*)0
);
vcal_manager_event_dump(event, FALSE, FALSE, calendar, FALSE);
tmp = g_strconcat(path, G_DIR_SEPARATOR_S, file, NULL);
@ -2050,7 +2050,7 @@ gboolean vcal_meeting_export_calendar(const gchar *path,
icalproperty_new_prodid(
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
0
(void*)0
);
for (cur = list; cur; cur = cur->next) {
@ -2162,7 +2162,7 @@ gboolean vcal_meeting_export_freebusy(const gchar *path, const gchar *user,
icalproperty_new_prodid(
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
0
(void*)0
);
timezone = icalcomponent_new(ICAL_VTIMEZONE_COMPONENT);
@ -2196,7 +2196,7 @@ gboolean vcal_meeting_export_freebusy(const gchar *path, const gchar *user,
ICAL_VFREEBUSY_COMPONENT,
icalproperty_vanew_dtstart(itt_start, 0),
icalproperty_vanew_dtend(itt_end, 0),
0
(void*)0
);
debug_print("DTSTART:%s\nDTEND:%s\n",