Fix possible string overflow in BTAdvertisedDeviceSet::toString()
This commit is contained in:
parent
41c372c143
commit
57cf2fb9f5
@ -47,8 +47,8 @@ std::string BTAdvertisedDeviceSet::toString() {
|
|||||||
res += val;
|
res += val;
|
||||||
}
|
}
|
||||||
if (haveRSSI()) {
|
if (haveRSSI()) {
|
||||||
char val[4];
|
char val[6];
|
||||||
snprintf(val, sizeof(val), "%d", getRSSI());
|
snprintf(val, sizeof(val), "%d", (int8_t)getRSSI());
|
||||||
res += ", rssi: ";
|
res += ", rssi: ";
|
||||||
res += val;
|
res += val;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user