From 8912abed06718fc011d483347e5571f22539eefd Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 10 Apr 2015 12:39:03 +0200 Subject: [PATCH 1/2] fix crash in uuid128_to_str --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 1e04255aa..4b550f588 100644 --- a/src/utils.c +++ b/src/utils.c @@ -176,7 +176,7 @@ void log_key(const char * name, sm_key_t key){ hexdump(key, 16); } -static char uuid128_to_str_buffer[16+4+1]; +static char uuid128_to_str_buffer[32+4+1]; char * uuid128_to_str(uint8_t * uuid){ sprintf(uuid128_to_str_buffer, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7], From a9d5294b4461d603399b423e05a963ac21c53e47 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 10 Apr 2015 12:39:28 +0200 Subject: [PATCH 2/2] log uuid128 instad of using printf --- ble/att.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ble/att.c b/ble/att.c index 84d02170c..19c27a4a2 100644 --- a/ble/att.c +++ b/ble/att.c @@ -208,7 +208,7 @@ void att_dump_attributes(void){ log_info("Handle: 0x%04x, flags: 0x%04x, uuid: ", it.handle, it.flags); if (it.flags & ATT_PROPERTY_UUID128){ swap128(it.uuid, uuid128); - printUUID128(uuid128); + log_info(uuid128_to_str(uuid128)); } else { log_info("%04x", READ_BT_16(it.uuid, 0)); }