From 0d0fcac2094192eab0f6fc2783674c334e3aa7ee Mon Sep 17 00:00:00 2001 From: Minjune Kim Date: Fri, 31 Aug 2012 17:52:04 +0900 Subject: [PATCH] Fix a crash Change-Id: If84edcff6a665e45bc8c4608664413823daf85fb --- debian/changelog | 7 +++++++ location_module/location_decarta.c | 9 +++++++++ packaging/libdecarta.spec | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 248ffba..e7a285f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libdecarta (0.2.8-1) unstable; urgency=low + + * Fix a crash : when we receive response without a position in geocode + * Tag: libdecarta_0.2.8-1 + + -- Minjune Kim Fri, 31 Aug 2012 23:22:31 +0900 + libdecarta (0.2.7-18) unstable; urgency=low * Add pref's properties diff --git a/location_module/location_decarta.c b/location_module/location_decarta.c index fa0ba02..42d5d51 100755 --- a/location_module/location_decarta.c +++ b/location_module/location_decarta.c @@ -315,6 +315,13 @@ position_cb (DecartaError deca_err, pos = get_location_pos_from_decarta_pos (geocode->pos); acc = location_accuracy_copy ((LocationAccuracy *)(data->userdata2)); + if (!pos) { + if (acc) { + location_accuracy_free(acc); + acc = NULL; + } + continue; + } DECARTA_LOGD("location decarta plugin: position_cb %d, lat %f, lon %f ", i++, pos->latitude, pos->longitude); position_list = g_list_append (position_list, (gpointer)pos); @@ -331,6 +338,7 @@ position_cb (DecartaError deca_err, error = convert_decarta_error_to_location_error (deca_err); } if (data->pos_cb) { + if (position_list == NULL) error = LOCATION_ERROR_NOT_FOUND; data->pos_cb(error, position_list, accuracy_list, data->userdata); } @@ -1044,6 +1052,7 @@ get_reverse_geocode(gpointer handle, decarta_geocode_free (geocode); } } + return convert_decarta_error_to_location_error (ret); } diff --git a/packaging/libdecarta.spec b/packaging/libdecarta.spec index 0c0fa06..6695944 100755 --- a/packaging/libdecarta.spec +++ b/packaging/libdecarta.spec @@ -7,7 +7,7 @@ Name: libdecarta Summary: Decarta Web Service Library (Shared Object) -Version: 0.2.7 +Version: 0.2.8 Release: 0 Group: TO_BE/FILLED_IN License: TO BE FILLED IN -- 2.7.4