From 426c5bfc15e33a74e563983e050d70292ce9ac1e Mon Sep 17 00:00:00 2001 From: Jeesun Kim Date: Thu, 12 Oct 2017 15:27:44 +0900 Subject: [PATCH] check invalid index in replace function Change-Id: I32402477d74dce180be05ec4475502c40ff0e9f9 --- server/db/cal_db_plugin_event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/db/cal_db_plugin_event.c b/server/db/cal_db_plugin_event.c index 4630561..92aeca9 100644 --- a/server/db/cal_db_plugin_event.c +++ b/server/db/cal_db_plugin_event.c @@ -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 */ -- 2.7.4