fix for heap buffer overflow 91/210991/2 accepted/tizen/unified/20190808.113647 submit/tizen/20190727.110623 submit/tizen/20190807.112356
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>
Sat, 27 Jul 2019 07:40:04 +0000 (13:10 +0530)
committerSameer Prakash Pradhan <sp.pradhan@samsung.com>
Sat, 27 Jul 2019 10:40:26 +0000 (16:10 +0530)
Signed-off-by: Sameer Prakash Pradhan <sp.pradhan@samsung.com>
Change-Id: I36b385f8e3939cfd42f498e95858e0ad2f49fcba

common/cal_vcalendar_parse.c
packaging/calendar-service.spec
server/db/cal_db_plugin_event_helper.c

index 893df09..6debec8 100644 (file)
@@ -2128,7 +2128,7 @@ static void __work_component_property_attendee_partstat(calendar_record_h attend
 
        /* check mailto */
        if (prop && CAL_STRING_EQUAL == strncmp(value + strlen(prop), ":MAILTO", strlen(":MAILTO")))
-               __work_component_property_attendee_mailto(attendee, value + strlen(prop) + strlen(":MAILTO") +1);
+               __work_component_property_attendee_mailto(attendee, value + strlen(prop) + strlen(":MAILTO"));
 }
 static void __work_component_property_attendee_rsvp(calendar_record_h attendee, char *value)
 {
index 59e132c..f9b6100 100644 (file)
@@ -97,6 +97,7 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
+mkdir -p %{buildroot}%{_unitdir_user}/default.target.wants
 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir_user}
 install -m 0644 %SOURCE5 %{buildroot}%{_unitdir_user}
 
index b40f141..f2b61e0 100644 (file)
@@ -526,6 +526,7 @@ void cal_db_event_apply_recurrence_id(int parent_id, cal_event_s *event, char *r
        g_strfreev(t);
 
        char *datetime = recurrence_id + strlen(recurrence_id) +1;
+       *(datetime + strlen(recurrence_id) +1) = '\0';
        int len_datetime = strlen(datetime);
        DBG("datetime[%s]", datetime);