check invalid index in replace function 26/155126/1 accepted/tizen/unified/20171012.191806 submit/tizen/20171012.071544
authorJeesun Kim <iamjs.kim@samsung.com>
Thu, 12 Oct 2017 06:27:44 +0000 (15:27 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Thu, 12 Oct 2017 06:27:56 +0000 (15:27 +0900)
Change-Id: I32402477d74dce180be05ec4475502c40ff0e9f9

server/db/cal_db_plugin_event.c

index 4630561..92aeca9 100644 (file)
@@ -1459,6 +1459,8 @@ static int _cal_db_event_replace_record(calendar_record_h record, int id)
        int input_ver = 0;
 
        RETV_IF(NULL == event, CALENDAR_ERROR_INVALID_PARAMETER);
+       RETV_IF(id <= 0, CALENDAR_ERROR_INVALID_PARAMETER);
+
        event->index = id;
 
        /* access control */