[svace] checked null before using pointer
[platform/core/pim/calendar-service.git] / common / cal_vcalendar_parse.c
index 7eab265..7619225 100644 (file)
@@ -1641,7 +1641,7 @@ static void __work_component_property_rrule_ver_1(char *value, calendar_record_h
                                if (true == has_by)
                                        week_index = 0;
 
-                               while (*(t[i] +j)) {
+                               while (t[i] + j && *(t[i] +j)) {
                                        switch (*(t[i] +j)) {
                                        case '+':
                                                exit_loop = true;
@@ -1663,7 +1663,7 @@ static void __work_component_property_rrule_ver_1(char *value, calendar_record_h
                                break;
                        default:
                                has_by = true;
-                               while (*(t[i] +j)) {
+                               while (t[i] + j && *(t[i] +j)) {
                                        switch (*(t[i] +j)) {
                                        case '+':
                                                exit_loop = true;