提交 5bff89f0 编写于 作者: W William Ferguson 提交者: Me No Dev

Fixed issue-3153 - Allocating enough memory to construct the entire UUID as a String. (#3297)

上级 9bbd720d
......@@ -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],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册