Fix a crash 2.0alpha master 2.0_alpha submit/master/20120920.151051
authorMinjune Kim <sena06.kim@samsung.com>
Fri, 31 Aug 2012 08:52:04 +0000 (17:52 +0900)
committerMinjune Kim <sena06.kim@samsung.com>
Fri, 31 Aug 2012 14:26:20 +0000 (23:26 +0900)
Change-Id: If84edcff6a665e45bc8c4608664413823daf85fb

debian/changelog
location_module/location_decarta.c
packaging/libdecarta.spec

index 248ffba..e7a285f 100644 (file)
@@ -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 <sena06.kim@samsung.com>  Fri, 31 Aug 2012 23:22:31 +0900
+
 libdecarta (0.2.7-18) unstable; urgency=low
 
   * Add pref's properties
index fa0ba02..42d5d51 100755 (executable)
@@ -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);
 }
 
index 0c0fa06..6695944 100755 (executable)
@@ -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