summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-02-22 21:31:35 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-02-22 21:31:35 +0000
commit0dfe8a30bc6fe92d3fa5fba14645099659e9142a (patch)
tree06c01ea47b226af15894824dfb3ef79faf1102e9
parent579685eea2ea30d4453f91751b67bfcbdd81a030 (diff)
Fix crash in get alias function
-rw-r--r--hcid/dbus-device.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hcid/dbus-device.c b/hcid/dbus-device.c
index 54646b80..b4dc5d68 100644
--- a/hcid/dbus-device.c
+++ b/hcid/dbus-device.c
@@ -182,13 +182,16 @@ static DBusMessage* handle_dev_get_alias_req(DBusMessage *msg, void *data)
DBusMessage *reply;
char str[249], *str_ptr = str, *addr_ptr;
bdaddr_t bdaddr;
+ int err;
dbus_message_iter_init(msg, &iter);
dbus_message_iter_get_basic(&iter, &addr_ptr);
str2ba(addr_ptr, &bdaddr);
- get_device_alias(dbus_data->dev_id, &bdaddr, str, sizeof(str));
+ err = get_device_alias(dbus_data->dev_id, &bdaddr, str, sizeof(str));
+ if (err < 0)
+ return bluez_new_failure_msg(msg, BLUEZ_ESYSTEM_OFFSET | -err);
reply = dbus_message_new_method_return(msg);