From fc5178c8f2d6607f93446842fcff1e0c1b82206d Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Fri, 9 Mar 2018 16:51:03 +0900 Subject: [PATCH] Add check routine - parameter, mem alloc fail, etc Change-Id: I954157bc8474267161f159dd1e7992732c90aac5 Signed-off-by: mk5004.lee --- unittest/src/test_design_element.cc | 4 +-- .../watchface-complication-provider.cc | 9 +++++ watchface-complication/complication.cc | 17 +++++++++ watchface-complication/design-element.cc | 8 +++++ watchface-complication/editables-container.cc | 21 +++++++++++ .../include/watchface-complication.h | 7 ++++ watchface-complication/received-editable.cc | 11 ++++++ watchface-complication/watchface-complication.cc | 39 ++++++++++++++++---- watchface-complication/watchface-editable.cc | 42 ++++++++++++++++++++++ watchface-editor/editables-editor.cc | 7 ++++ watchface-editor/watchface-editor.cc | 35 ++++++++++++++++++ 11 files changed, 191 insertions(+), 9 deletions(-) diff --git a/unittest/src/test_design_element.cc b/unittest/src/test_design_element.cc index 32610c2..ccf6d48 100755 --- a/unittest/src/test_design_element.cc +++ b/unittest/src/test_design_element.cc @@ -93,8 +93,8 @@ TEST_F(DE, GetData) TEST_F(DE, GetCurDataIdx) { - EXPECT_EQ(DE::element->SetCurDataIdx(1), 0); - EXPECT_EQ(DE::element->GetCurDataIdx(), 1); + EXPECT_EQ(DE::element->SetCurDataIdx(0), 0); + EXPECT_EQ(DE::element->GetCurDataIdx(), 0); } TEST_F(DE, GetName) diff --git a/watchface-complication-provider/watchface-complication-provider.cc b/watchface-complication-provider/watchface-complication-provider.cc index 941bca1..abc4c60 100644 --- a/watchface-complication-provider/watchface-complication-provider.cc +++ b/watchface-complication-provider/watchface-complication-provider.cc @@ -96,6 +96,9 @@ class WatchComplicationProviderStub : public ComplicationProvider { static std::map __providers; extern "C" EXPORT_API int complication_provider_update_request_cb_add( const char *provider_id, on_update_request cb, void *user_data) { + if (provider_id == NULL || cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + // TODO(?): Provider ID validation // TODO(?): Get provider's support type from storage int support_types = ShortText | Image; @@ -113,11 +116,17 @@ extern "C" EXPORT_API int complication_provider_update_request_cb_add( extern "C" EXPORT_API int complication_provider_update_request_cb_del( const char *provider_id, on_update_request cb, void *user_data) { + if (provider_id == NULL || cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } extern "C" EXPORT_API int complication_provider_get_support_types( const char *provider_id, int *types) { + if (provider_id == NULL || types == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } diff --git a/watchface-complication/complication.cc b/watchface-complication/complication.cc index a88876f..8b28559 100755 --- a/watchface-complication/complication.cc +++ b/watchface-complication/complication.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include "watchface-complication/complication.h" #include "watchface-complication/complication-implementation.h" @@ -62,6 +63,9 @@ Complication::Impl::Impl(Complication* parent, int id, parent_->GetProviderList(static_cast(type)); for (auto& provider_id : provider_list) { bundle* data = bundle_create(); + if (data == NULL) + std::runtime_error("bundle create failed"); + bundle_add_str(data, provider_id_key_.c_str(), provider_id.c_str()); bundle_add_str(data, provider_type_key_.c_str(), std::to_string(type).c_str()); candidates_list_.emplace_back(new Bundle(data)); @@ -384,6 +388,10 @@ const char* Complication::GetCurProviderId() { const char* Complication::GetProviderId(Bundle& data) { char* provider_id = NULL; + + if (data.GetRaw() == nullptr) + return NULL; + bundle_get_str(data.GetRaw(), impl_->provider_id_key_.c_str(), &provider_id); return provider_id; @@ -404,6 +412,10 @@ int Complication::GetCurType() { int Complication::GetType(Bundle& data) { char* type; int ret = -1; + + if (data.GetRaw() == nullptr) + return ret; + bundle_get_str(data.GetRaw(), impl_->provider_type_key_.c_str(), &type); if (type) @@ -417,6 +429,9 @@ const std::string& Complication::GetName() { } void Complication::SetName(const std::string& name) { + if (name.empty()) + return; + impl_->name_ = name; } @@ -475,6 +490,8 @@ void Complication::SendDataUpdateRequest() { std::string provider_appid = impl_->GetProviderAppId(); const char* context_data_raw = ""; bundle *arg_list = bundle_create(); + if (arg_list == NULL) + std::runtime_error("bundle create failed"); appsvc_set_operation(arg_list, APPSVC_OPERATION_DEFAULT); appsvc_set_appid(arg_list, provider_appid.c_str()); diff --git a/watchface-complication/design-element.cc b/watchface-complication/design-element.cc index e460c99..3582610 100644 --- a/watchface-complication/design-element.cc +++ b/watchface-complication/design-element.cc @@ -92,6 +92,11 @@ int DesignElement::UpdateLastDataIdx() { } int DesignElement::SetCurDataIdx(int cur_data_idx) { + if (cur_data_idx < 0 || cur_data_idx >= (int)impl_->candidates_list_.size()) { + LOGE("Invalid index"); + return -1; + } + LOGI("set cur data %d", cur_data_idx); impl_->cur_data_idx_ = cur_data_idx; return 0; @@ -102,6 +107,9 @@ const std::string& DesignElement::GetName() { } void DesignElement::SetName(const std::string& name) { + if (name.empty()) + return; + impl_->name_ = name; } diff --git a/watchface-complication/editables-container.cc b/watchface-complication/editables-container.cc index e34b055..594b8e5 100644 --- a/watchface-complication/editables-container.cc +++ b/watchface-complication/editables-container.cc @@ -120,9 +120,18 @@ int EditablesContainer::RequestEdit(const std::string& editor_id) { bundle_raw *str_raw = NULL; std::unique_ptr list_arr(new const char*[impl_->ed_list_.size()]); + if (editor_id.empty()) + return -1; + for (auto& i : impl_->ed_list_) { i.get()->SetState(IEditable::OnGoing); bundle* ed = bundle_create(); + if (ed == NULL) { + if (str_raw) + free(str_raw); + return -1; + } + bundle_add(ed, "EDITABLE_ID", std::to_string(i.get()->GetId()).c_str()); int cur_data_idx = i.get()->GetCurDataIdx(); @@ -152,6 +161,12 @@ int EditablesContainer::RequestEdit(const std::string& editor_id) { } bundle* container = bundle_create(); + if (container == NULL) { + if (str_raw) + free(str_raw); + return -1; + } + bundle_add_str_array(container, "EDITABLE_LIST", list_arr.get(), list_idx); bundle_encode(container, &str_raw, &str_len); @@ -181,11 +196,17 @@ void EditablesContainer::OnEditReady(const std::string& editor_id) { } int EditablesContainer::Add(std::shared_ptr ed) { + if (ed == nullptr) + return -1; + impl_->ed_list_.push_back(ed); return 0; } int EditablesContainer::Remove(std::shared_ptr ed) { + if (ed == nullptr) + return -1; + for (auto& i : impl_->ed_list_) { if (i.get() == ed.get()) { impl_->ed_list_.remove(i); diff --git a/watchface-complication/include/watchface-complication.h b/watchface-complication/include/watchface-complication.h index 9775906..a1032b8 100644 --- a/watchface-complication/include/watchface-complication.h +++ b/watchface-complication/include/watchface-complication.h @@ -25,12 +25,19 @@ extern "C" { #endif typedef enum _complication_type { + COMPLICATION_TYPE_NONE = 0x00, COMPLICATION_SHORT_TEXT = 0x01, COMPLICATION_LONG_TEXT = 0x02, COMPLICATION_RANGED_VALUE = 0x04, COMPLICATION_TIME = 0x08, COMPLICATION_ICON = 0x10, COMPLICATION_IMAGE = 0x20, + COMPLICATION_TYPE_MAX = COMPLICATION_SHORT_TEXT | + COMPLICATION_LONG_TEXT | + COMPLICATION_RANGED_VALUE | + COMPLICATION_TIME | + COMPLICATION_ICON | + COMPLICATION_IMAGE, } complication_type; typedef enum _complication_shape_type { diff --git a/watchface-complication/received-editable.cc b/watchface-complication/received-editable.cc index 439bb08..240b389 100644 --- a/watchface-complication/received-editable.cc +++ b/watchface-complication/received-editable.cc @@ -37,6 +37,8 @@ ReceivedEditable::ReceivedEditable(std::string raw) ReceivedEditable::~ReceivedEditable() = default; ReceivedEditable::Impl::Impl(ReceivedEditable* parent, std::string raw) : parent_(parent) { + if (raw.empty()) + return; bundle* data = bundle_decode( reinterpret_cast( @@ -116,6 +118,11 @@ Bundle& ReceivedEditable::GetNthData(int nth) { } int ReceivedEditable::SetCurDataIdx(int cur_data_idx) { + if (cur_data_idx < 0 || cur_data_idx >= (int)impl_->candidates_list_.size()) { + LOGE("Invalid index"); + return -1; + } + impl_->cur_data_idx_ = cur_data_idx; return 0; } @@ -123,7 +130,11 @@ int ReceivedEditable::SetCurDataIdx(int cur_data_idx) { const std::string& ReceivedEditable::GetName() { return impl_->name_; } + void ReceivedEditable::SetName(const std::string& name) { + if (name.empty()) + return; + impl_->name_ = name; } diff --git a/watchface-complication/watchface-complication.cc b/watchface-complication/watchface-complication.cc index 7ec3095..a427e72 100644 --- a/watchface-complication/watchface-complication.cc +++ b/watchface-complication/watchface-complication.cc @@ -1,4 +1,3 @@ - /* * Copyright (c) 2017 Samsung Electronics Co., Ltd. * @@ -100,6 +99,8 @@ class WatchComplicationStub : public Complication { extern "C" EXPORT_API int complication_update_cb_add(complication_h handle, on_complication_update cb, void *user_data) { + if (handle == NULL || cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; auto sh = static_cast*>(handle); auto ptr = SharedHandle::Share(sh); @@ -110,15 +111,24 @@ extern "C" EXPORT_API int complication_update_cb_add(complication_h handle, extern "C" EXPORT_API int complication_update_cb_del(complication_h handle, on_complication_update cb) { + if (handle == NULL || cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } extern "C" EXPORT_API int complication_set_provider(const char *provider_id) { + if (provider_id == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } extern "C" EXPORT_API int complication_send_update_request( complication_h handle) { + if (handle == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + LOGI("update call!!"); auto sh = static_cast*>(handle); auto ptr = SharedHandle::Share(sh); @@ -128,12 +138,9 @@ extern "C" EXPORT_API int complication_send_update_request( } extern "C" EXPORT_API int complication_get_id(complication_h handle) { - return -1; -} + if (handle == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; -int __get_complication_data(int complication_id, char **provider_id, - complication_type *comp_type) { - // TODO(?): return saved value return -1; } @@ -141,6 +148,10 @@ extern "C" EXPORT_API int complication_create(int complication_id, const char *default_provider_id, complication_type default_type, int support_types, complication_shape_type shape_type, complication_h *created_handle) { + if (support_types <= COMPLICATION_TYPE_NONE || + support_types > COMPLICATION_TYPE_MAX) + return COMPLICATION_ERROR_INVALID_PARAMETER; + // TODO(?) check default value and type is valid auto ws = new WatchComplicationStub( complication_id, @@ -157,6 +168,8 @@ extern "C" EXPORT_API int complication_create(int complication_id, } extern "C" EXPORT_API int complication_destroy(complication_h handle) { + if (handle == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; auto sh = static_cast*>(handle); delete sh; @@ -166,6 +179,9 @@ extern "C" EXPORT_API int complication_destroy(complication_h handle) { extern "C" EXPORT_API int complication_get_cur_provider_id(complication_h handle, const char** cur_provider_id) { + if (handle == NULL || cur_provider_id == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + auto sh = static_cast*>(handle); auto ptr = SharedHandle::Share(sh); *cur_provider_id = ptr.get()->GetCurProviderId(); @@ -175,6 +191,9 @@ extern "C" EXPORT_API int complication_get_cur_provider_id(complication_h handle extern "C" EXPORT_API int complication_get_cur_type(complication_h handle, complication_type* cur_type) { + if (handle == NULL || cur_type == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + auto sh = static_cast*>(handle); auto ptr = SharedHandle::Share(sh); int ret = ptr.get()->GetCurType(); @@ -186,6 +205,9 @@ extern "C" EXPORT_API int complication_get_cur_type(complication_h handle, extern "C" EXPORT_API int complication_get_provider_id(const bundle* candidate, const char** provider_id) { + if (candidate == NULL || provider_id == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + char* val = NULL; bundle_get_str(const_cast(candidate), @@ -200,6 +222,9 @@ extern "C" EXPORT_API int complication_get_provider_id(const bundle* candidate, extern "C" EXPORT_API int complication_get_type(const bundle* candidate, complication_type* cur_type) { + if (candidate == NULL || cur_type == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + char* val = NULL; bundle_get_str(const_cast(candidate), @@ -210,4 +235,4 @@ extern "C" EXPORT_API int complication_get_type(const bundle* candidate, return -1; return 0; -} \ No newline at end of file +} diff --git a/watchface-complication/watchface-editable.cc b/watchface-complication/watchface-editable.cc index 5c0b518..303d4dc 100644 --- a/watchface-complication/watchface-editable.cc +++ b/watchface-complication/watchface-editable.cc @@ -130,6 +130,9 @@ static EditablesContainerStub *__container; extern "C" EXPORT_API int editable_add_design_element(editable_container_h handle, int edit_id, int cur_data_idx, GList* candiatelist, editable_geo geo, const char* editable_name) { + if (handle == NULL || candiatelist == NULL || editable_name == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + EditablesContainerStub* ec = static_cast(handle); bundle* data; int str_len = 0; @@ -160,6 +163,9 @@ extern "C" EXPORT_API int editable_add_design_element(editable_container_h handl extern "C" EXPORT_API int editable_add_complication(editable_container_h handle, int edit_id, complication_h comp, editable_geo geo, const char* editable_name) { + if (handle == NULL || comp == NULL || editable_name == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + EditablesContainerStub* ec = static_cast(handle); SharedHandle* sh = static_cast*>(comp); @@ -172,6 +178,9 @@ extern "C" EXPORT_API int editable_add_complication(editable_container_h handle, extern "C" EXPORT_API int editable_request_edit(editable_container_h handle, const char *editor_appid, on_editable_update cb, void *user_data) { + if (handle == NULL || editor_appid == NULL || cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + EditablesContainerStub* ec = static_cast(handle); auto ci = new UpdateCallbackInfo(cb, user_data); ec->ClearUpdateCallbackInfo(); @@ -185,6 +194,9 @@ extern "C" EXPORT_API int editable_request_edit(editable_container_h handle, extern "C" EXPORT_API int editable_on_edit_ready_cb_add(on_edit_ready cb, void *user_data) { + if (cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + if (__container == NULL) __container = new EditablesContainerStub(); @@ -195,11 +207,17 @@ extern "C" EXPORT_API int editable_on_edit_ready_cb_add(on_edit_ready cb, } extern "C" EXPORT_API int editable_on_edit_ready_cb_del(on_edit_ready cb) { + if (cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } extern "C" EXPORT_API int editable_get_cur_data_idx(const editable_h handle, int *idx) { + if (handle == NULL || idx == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ie = static_cast(handle); *idx = ie->GetCurDataIdx(); return 0; @@ -207,6 +225,9 @@ extern "C" EXPORT_API int editable_get_cur_data_idx(const editable_h handle, extern "C" EXPORT_API int editable_set_cur_data_idx(const editable_h handle, int idx) { + if (handle == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ie = static_cast(handle); ie->SetCurDataIdx(idx); return 0; @@ -214,6 +235,9 @@ extern "C" EXPORT_API int editable_set_cur_data_idx(const editable_h handle, extern "C" EXPORT_API int editable_get_cur_data(const editable_h handle, bundle **cur_data) { + if (handle == NULL || cur_data == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ie = static_cast(handle); Bundle& data = ie->GetCurData(); *cur_data = data.GetRaw(); @@ -222,6 +246,9 @@ extern "C" EXPORT_API int editable_get_cur_data(const editable_h handle, extern "C" EXPORT_API int editable_get_nth_data(const editable_h handle, int nth, bundle **cur_data) { + if (handle == NULL || cur_data == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ie = static_cast(handle); Bundle& data = ie->GetNthData(nth); *cur_data = data.GetRaw(); @@ -230,6 +257,9 @@ extern "C" EXPORT_API int editable_get_nth_data(const editable_h handle, extern "C" EXPORT_API int editable_get_editable_id(const editable_h handle, int *editable_id) { + if (handle == NULL || editable_id == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ie = static_cast(handle); *editable_id = ie->GetId(); @@ -237,16 +267,25 @@ extern "C" EXPORT_API int editable_get_editable_id(const editable_h handle, } extern "C" EXPORT_API int editable_get_geometry(const editable_h handle, editable_geo *geo) { + if (handle == NULL || geo == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } extern "C" EXPORT_API int editable_get_candidates_list(const editable_h handle, GList **candiates_list) { + if (handle == NULL || candiates_list == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } extern "C" EXPORT_API int editable_get_editable_name(const editable_h handle, const char **editable_name) { + if (handle == NULL || editable_name == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ie = static_cast(handle); if (!ie->GetName().empty()) *editable_name = ie->GetName().c_str(); @@ -255,6 +294,9 @@ extern "C" EXPORT_API int editable_get_editable_name(const editable_h handle, extern "C" EXPORT_API int editable_set_editable_name(const editable_h handle, const char *editable_name) { + if (handle == NULL || editable_name == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ie = static_cast(handle); ie->SetName(std::string(editable_name)); return 0; diff --git a/watchface-editor/editables-editor.cc b/watchface-editor/editables-editor.cc index 03ce833..f4fd1c5 100644 --- a/watchface-editor/editables-editor.cc +++ b/watchface-editor/editables-editor.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include "watchface-editor/editables-editor.h" #include "watchface-editor/editables-editor-implementation.h" @@ -73,6 +74,9 @@ void EditablesEditor::Impl::OnSignal(const std::string& sender_name, const char **str_arr = NULL; int len = 0; + if (data == NULL) + throw std::runtime_error("bundle decode failed"); + str_arr = bundle_get_str_array(data, "EDITABLE_LIST", &len); for (int i = 0; i < len; i++) { e_list.emplace_back(std::unique_ptr( @@ -142,6 +146,9 @@ int EditablesEditor::EditCancel() { } int EditablesEditor::NotifyEditReady(std::string appid) { + if (appid.empty()) + return -1; + ComplicationConnector::GetInst().EmitSignal( ComplicationConnector::Editable, appid, diff --git a/watchface-editor/watchface-editor.cc b/watchface-editor/watchface-editor.cc index 14330a4..4ae429d 100644 --- a/watchface-editor/watchface-editor.cc +++ b/watchface-editor/watchface-editor.cc @@ -99,6 +99,9 @@ class EditablesEditorStub : public EditablesEditor { static std::unique_ptr __stub = nullptr; extern "C" EXPORT_API int editor_on_request_edit_cb_add(on_request_edit cb, void *user_data) { + if (cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + if (__stub == nullptr) __stub = std::unique_ptr(new EditablesEditorStub()); @@ -109,11 +112,17 @@ extern "C" EXPORT_API int editor_on_request_edit_cb_add(on_request_edit cb, } extern "C" EXPORT_API int editor_on_request_edit_cb_del(on_request_edit cb) { + if (cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + return 0; } extern "C" EXPORT_API int editor_edit_preview(const editable_h ed_h, int cur_data_idx) { + if (ed_h == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + IEditable* ed = static_cast(ed_h); ed->SetCurDataIdx(cur_data_idx); return __stub->EditPreview(*ed, cur_data_idx); @@ -128,6 +137,9 @@ extern "C" EXPORT_API int editor_edit_cancel() { } extern "C" EXPORT_API int editor_notify_edit_ready(const char *appid) { + if (appid == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + if (__stub == nullptr) __stub = std::unique_ptr(new EditablesEditorStub()); else @@ -140,6 +152,9 @@ extern "C" EXPORT_API int editor_notify_edit_ready(const char *appid) { extern "C" EXPORT_API int editor_foreach_editable_list(editable_list_h list_h, editable_list_foreach_cb cb, void *user_data) { + if (list_h == NULL || cb == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + GList *iter = list_h; while (iter) { cb((editable_h)iter->data, user_data); @@ -151,6 +166,11 @@ extern "C" EXPORT_API int editor_foreach_editable_list(editable_list_h list_h, extern "C" EXPORT_API editable_list_h editor_editable_list_dup( editable_list_h source) { + if (source == NULL) { + LOGE("Invalid parameter"); + return NULL; + } + GList* dest = NULL; GList* iter = source; while (iter) { @@ -172,6 +192,11 @@ extern "C" EXPORT_API int editor_editable_list_size(editable_list_h list) { extern "C" EXPORT_API const editable_h editor_editable_list_nth( editable_list_h list, int nth) { + if (list == NULL) { + LOGE("Invalid parameter"); + return NULL; + } + GList* iter = list; int idx = 0; while (iter) { @@ -185,6 +210,11 @@ extern "C" EXPORT_API const editable_h editor_editable_list_nth( extern "C" EXPORT_API int editor_editable_candidate_list_size(const editable_h ed_h) { + if (ed_h == NULL) { + LOGE("Invalid parameter"); + return -1; + } + IEditable* ed = static_cast(ed_h); std::list> const& list = ed->GetCandidates(); return list.size(); @@ -192,6 +222,11 @@ extern "C" EXPORT_API int editor_editable_candidate_list_size(const editable_h e extern "C" EXPORT_API const bundle* editor_editable_candidate_list_nth( const editable_h ed_h, int nth) { + if (ed_h == NULL) { + LOGE("Invalid parameter"); + return NULL; + } + IEditable* ed = static_cast(ed_h); const std::list>& list = ed->GetCandidates(); const std::list>::const_iterator it -- 2.7.4