heap buffer overflow fix 97/210197/1 accepted/tizen/unified/20190722.112750 submit/tizen/20190719.063546
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>
Tue, 16 Jul 2019 13:47:02 +0000 (19:17 +0530)
committerSameer Prakash Pradhan <sp.pradhan@samsung.com>
Tue, 16 Jul 2019 13:47:02 +0000 (19:17 +0530)
Change-Id: I81d160bbf07ec2d916946f4a80a6fa796ad67284
Signed-off-by: Sameer Prakash Pradhan <sp.pradhan@samsung.com>
common/cal_vcalendar_parse.c

index add546e..893df09 100644 (file)
@@ -342,14 +342,14 @@ static bool __check_has_rrule(char *stream)
        char *cursor = stream;
        while (*cursor) {
                if (*(cursor++) == VCAL_LF) {
-                       if (*(cursor++) == 'R' &&
+                       if (*cursor && *(cursor++) == 'R' &&
                                        *(cursor++) == 'R' &&
                                        *(cursor++) == 'U' &&
                                        *(cursor++) == 'L' &&
                                        *(cursor++) == 'E' &&
                                        *(cursor++) == ':') {
                                return true;
-                       } else if (*(cursor-1) == 'E' &&
+                       } else if (*cursor && *(cursor-1) == 'E' &&
                                        *(cursor++) == 'N' &&
                                        *(cursor++) == 'D' &&
                                        *(cursor++) == ':' &&
@@ -1972,7 +1972,7 @@ static void __work_component_property_dtend(char *value, calendar_record_h recor
 static void __work_component_property_attendee_mailto(calendar_record_h attendee, char *value)
 {
        RET_IF(NULL == value);
-       RET_IF(NULL == *value);
+       RET_IF('\0' == *value);
        RET_IF(NULL == attendee);
 
        int ret = 0;