Added code to check potential issue 11/209611/1
authorRandeep Singh <randeep.s@samsung.com>
Tue, 9 Jul 2019 09:14:47 +0000 (14:44 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Tue, 9 Jul 2019 09:14:47 +0000 (14:44 +0530)
Change-Id: Ic1e78f94245f73c083d05f2c9357e8b131031465
Signed-off-by: Randeep Singh <randeep.s@samsung.com>
common/cal_record.c

index ea7cb7a..9ae11dc 100644 (file)
@@ -109,9 +109,14 @@ static inline void _cal_record_set_property_flag(calendar_record_h record, unsig
                        /* LCOV_EXCL_STOP */
                }
        }
+    if (index < _record->properties_max_count) {
+         _record->properties_flags[index] |= flag;
+        _record->property_flag |= flag;
+    } else {
+        ERR("index out of range");
+        return;
+    }
 
-       _record->properties_flags[index] |= flag;
-       _record->property_flag |= flag;
 }
 
 bool cal_record_check_property_flag(calendar_record_h record, unsigned int property_id, cal_properties_flag_e flag)