int i = 0;
while (VCAL_LF != *(cursor + offset + i)) {
- if ('\0' == *(cursor + offset + i))
+ if ('\0' == *(cursor + offset + i)) {
+ DBG("Invalid value");
return NULL;
-
+ }
i++;
}
switch (index) {
case VCAL_PROPERTY_VERSION:
cursor = __get_value(cursor, &value);
+ if (NULL == cursor)
+ break;
__get_version(value, &ud->version);
free(value);
value = NULL;
if (ud->timezone_tzid)
break;
cursor = __get_value(cursor, &value);
+ if (NULL == cursor)
+ break;
__get_tz(value + 1, &ud->timezone_tzid);
__adjust_tzid(ud->timezone_tzid);
DBG("timezone_tzid[%s]", ud->timezone_tzid);
case VCAL_PROPERTY_BEGIN: /* BEGIN:VEVENT */
cursor = __work_property_begin(cursor, &record, ud);
+ if (NULL == cursor)
+ break;
calendar_list_add(list, record);
count++;
if (foreach_data) {