Buffer overflow issue fixed 00/235700/2 accepted/tizen/unified/20200618.130101 submit/tizen/20200617.044059
authorLohit Agarwalla <l.agarwalla@samsung.com>
Tue, 9 Jun 2020 04:37:30 +0000 (10:07 +0530)
committerLOHIT AGARWALLA <l.agarwalla@samsung.com>
Fri, 12 Jun 2020 09:01:24 +0000 (09:01 +0000)
Change-Id: Ia43d40055dcc5da5355f5068f9f6c73515bf3d5d
Signed-off-by: Lohit Agarwalla <l.agarwalla@samsung.com>
server/db/cal_db_plugin_event_helper.c

index 376d2ab..7f8947f 100644 (file)
@@ -522,7 +522,9 @@ void cal_db_event_apply_recurrence_id(int parent_id, cal_event_s *event, char *r
        }
        int count = g_strv_length(t);
        int len_param = strlen(t[count -1]);
-       *(recurrence_id + strlen(recurrence_id) - len_param -1) = '\0';
+       char *loc = recurrence_id + strlen(recurrence_id) - len_param - 1;
+       if(loc > recurrence_id && loc < recurrence_id + strlen(recurrence_id))
+               *loc = '\0';
        g_strfreev(t);
 
        char *datetime = recurrence_id;