summaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-pbap-binding.c
diff options
context:
space:
mode:
authorRaquel Medina <raquel.medina@konsulko.com>2020-10-21 13:20:34 +0200
committerRaquel Medina <raquel.medina@konsulko.com>2020-10-26 13:30:44 +0100
commitbdcd1fe42febb04e1be428bdfa022f89b65a1cb1 (patch)
tree739091f4a4857d57b48e0a20fc6a6e7fc7bc5381 /binding/bluetooth-pbap-binding.c
parent512c2dc6df87fff1fca05d791bb28a5b3faa2586 (diff)
The segmentation fault manifests if the remote disconnects pbap transport followed by a refresh pbap data operation. The root cause is a read operation of vcard data for the calls history, ignoring the error triggered while attempting to access the corresponding file on the remote device. The current patch introduces the missing check for errors. SPEC-3652 Signed-off-by: Raquel Medina <raquel.medina@konsulko.com> Change-Id: I916ba5b8b5fc29aa9b928dbf2ed3e7c892d15891 test & deleteme Signed-off-by: Raquel Medina <raquel.medina@konsulko.com> Change-Id: I9efa151af54ae87cbf7e67bb6b985a76e0814549
Diffstat (limited to 'binding/bluetooth-pbap-binding.c')
-rw-r--r--binding/bluetooth-pbap-binding.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/binding/bluetooth-pbap-binding.c b/binding/bluetooth-pbap-binding.c
index 1ff6e82..ccfbb7c 100644
--- a/binding/bluetooth-pbap-binding.c
+++ b/binding/bluetooth-pbap-binding.c
@@ -473,8 +473,15 @@ void history(afb_req_t request)
if (!parse_max_entries_parameter(request, &max_entries))
return;
- org_bluez_obex_phonebook_access1_call_select_sync(
- phonebook, INTERNAL, list, NULL, NULL);
+ if (!phonebook)
+ return;
+
+ if (!org_bluez_obex_phonebook_access1_call_select_sync(
+ phonebook, INTERNAL, COMBINED, NULL, NULL)) {
+ afb_req_fail(request, "cannot import call history", NULL);
+ return;
+ }
+
jresp = get_vcards(max_entries);
afb_req_success(request, jresp, "call history");