Change-Id: I55ca5ceb6d3deb44eb4e943c7f7f377bfcec7273
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
list_handle->candidates_list == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
list_handle->candidates_list == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
- if (cur_data_idx < 0 &&
+ if (cur_data_idx < 0 ||
cur_data_idx >= static_cast<int>(
g_list_length(list_handle->candidates_list)))
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
cur_data_idx >= static_cast<int>(
g_list_length(list_handle->candidates_list)))
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
SharedHandle<IEditable>* ptr = static_cast<SharedHandle<IEditable>*>(handle);
shared_ptr<IEditable> ed = ptr->GetPtr();
const std::list<std::shared_ptr<Bundle>>& list = ed->GetCandidates();
SharedHandle<IEditable>* ptr = static_cast<SharedHandle<IEditable>*>(handle);
shared_ptr<IEditable> ed = ptr->GetPtr();
const std::list<std::shared_ptr<Bundle>>& list = ed->GetCandidates();
+ if (nth < 0 || nth >= static_cast<int>(list.size())) {
+ LOGE("Invalid parameter");
+ return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
+ }
+
const std::list<std::shared_ptr<Bundle>>::const_iterator it
= list.begin();
auto nx = std::next(it, nth);
const std::list<std::shared_ptr<Bundle>>::const_iterator it
= list.begin();
auto nx = std::next(it, nth);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
+ if (handle == NULL || exist == NULL) {
LOGE("Invalid parameter");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
LOGE("Invalid parameter");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}