Skip to content
Permalink
Browse files

Fixed issue-3153 - Allocating enough memory to construct the entire U…

…UID as a String. (#3297)
  • Loading branch information...
william-ferguson-au authored and me-no-dev committed Sep 29, 2019
1 parent 9bbd720 commit 5bff89f0be51da3a6306a342e75517f861ba61c9
Showing with 1 addition and 1 deletion.
  1. +1 −1 libraries/BLE/src/BLEUUID.cpp
@@ -367,7 +367,7 @@ std::string BLEUUID::toString() {
//
// UUID string format:
// AABBCCDD-EEFF-GGHH-IIJJ-KKLLMMNNOOPP
auto size = 35;
auto size = 37; // 32 for UUID data, 4 for '-' delimiters and one for a terminator == 37 chars
char *hex = (char *)malloc(size);
snprintf(hex, size, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
m_uuid.uuid.uuid128[15], m_uuid.uuid.uuid128[14],

0 comments on commit 5bff89f

Please sign in to comment.
You can’t perform that action at this time.