summaryrefslogtreecommitdiff
path: root/src/lib/elocation
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2014-11-12 10:18:58 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2014-11-12 10:21:00 +0100
commit41409410490c6f56ae61c8f7de90619e9983fc83 (patch)
tree97fdc3e06f920c1400868a6e9f10f013343a00a6 /src/lib/elocation
parent0042d3b2eaac7f2c25e6e5e06b1a931ca1fea844 (diff)
elocation: Check return from eldbus_message_iter_arguments_get
Coverity spotted my laziness here with the eldbus functions. Better check that they actually succeeded. CID: 1251470, 1251471, 1251472, 1251473
Diffstat (limited to 'src/lib/elocation')
-rw-r--r--src/lib/elocation/elocation.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/lib/elocation/elocation.c b/src/lib/elocation/elocation.c
index 0722a56b93..6cc5af051e 100644
--- a/src/lib/elocation/elocation.c
+++ b/src/lib/elocation/elocation.c
@@ -244,7 +244,9 @@ unmarshall_address(const Eldbus_Message *reply, Elocation_Address *addr)
244 } 244 }
245 } 245 }
246 246
247 eldbus_message_iter_arguments_get(sub, "idd", &level, &horizontal, &vertical); 247 if (!eldbus_message_iter_arguments_get(sub, "idd", &level, &horizontal, &vertical))
248 return EINA_FALSE;
249
248 addr->accur->level = level; 250 addr->accur->level = level;
249 addr->accur->horizontal = horizontal; 251 addr->accur->horizontal = horizontal;
250 addr->accur->vertical = vertical; 252 addr->accur->vertical = vertical;
@@ -301,11 +303,13 @@ poi_cb(void *data EINA_UNUSED, const Eldbus_Message *reply, Eldbus_Pending *pend
301 /* TODO re-check that the parameter ordering is what we expect */ 303 /* TODO re-check that the parameter ordering is what we expect */
302 while (eldbus_message_iter_get_and_next(array, 'r', &struct_landmark)) 304 while (eldbus_message_iter_get_and_next(array, 'r', &struct_landmark))
303 { 305 {
304 eldbus_message_iter_arguments_get(struct_landmark, "iiddddddsssssssssss", &id, &rank, 306 if (!eldbus_message_iter_arguments_get(struct_landmark, "iiddddddsssssssssss", &id, &rank,
305 &lat, &lon, &bound_left, &bound_top, &bound_right, 307 &lat, &lon, &bound_left, &bound_top, &bound_right,
306 &bound_bottom, &name, &icon, &house, &road, 308 &bound_bottom, &name, &icon, &house, &road,
307 &village, &suburb, &postcode, &city, &county, 309 &village, &suburb, &postcode, &city, &county,
308 &country, &country_code); 310 &country, &country_code))
311 return;
312
309 DBG("Landmark received: %i, %i, %f, %f, %f, %f, %f, %f, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,", 313 DBG("Landmark received: %i, %i, %f, %f, %f, %f, %f, %f, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,",
310 id, rank, lat, lon, bound_left, bound_top, bound_right, 314 id, rank, lat, lon, bound_left, bound_top, bound_right,
311 bound_bottom, name, icon, house, road, village, 315 bound_bottom, name, icon, house, road, village,
@@ -357,7 +361,9 @@ geocode_cb(void *data EINA_UNUSED, const Eldbus_Message *reply, Eldbus_Pending *
357 else 361 else
358 pos_geocode->altitude = 0.0; 362 pos_geocode->altitude = 0.0;
359 363
360 eldbus_message_iter_arguments_get(sub, "idd", &level, &horizontal, &vertical); 364 if (!eldbus_message_iter_arguments_get(sub, "idd", &level, &horizontal, &vertical))
365 return;
366
361 pos_geocode->accur->level = level; 367 pos_geocode->accur->level = level;
362 pos_geocode->accur->horizontal = horizontal; 368 pos_geocode->accur->horizontal = horizontal;
363 pos_geocode->accur->vertical = vertical; 369 pos_geocode->accur->vertical = vertical;
@@ -555,7 +561,9 @@ unmarshall_satellite(const Eldbus_Message *reply)
555 /* TODO re-check that the parameter ordering is what we expect */ 561 /* TODO re-check that the parameter ordering is what we expect */
556 while (eldbus_message_iter_get_and_next(sub_info, 'r', &struct_info)) 562 while (eldbus_message_iter_get_and_next(sub_info, 'r', &struct_info))
557 { 563 {
558 eldbus_message_iter_arguments_get(struct_info, "iiii", &prn, &elevation, &azimuth, &snr); 564 if (!eldbus_message_iter_arguments_get(struct_info, "iiii", &prn, &elevation, &azimuth, &snr))
565 return EINA_FALSE;
566
559 DBG("Satellite info %i, %i, %i, %i", prn, elevation, azimuth, snr); 567 DBG("Satellite info %i, %i, %i, %i", prn, elevation, azimuth, snr);
560 } 568 }
561 569