Skip to content

Commit 57cf2fb

Browse files
committed
Fix possible string overflow in BTAdvertisedDeviceSet::toString()
1 parent 41c372c commit 57cf2fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ std::string BTAdvertisedDeviceSet::toString() {
4747
res += val;
4848
}
4949
if (haveRSSI()) {
50-
char val[4];
51-
snprintf(val, sizeof(val), "%d", getRSSI());
50+
char val[6];
51+
snprintf(val, sizeof(val), "%d", (int8_t)getRSSI());
5252
res += ", rssi: ";
5353
res += val;
5454
}

0 commit comments

Comments
 (0)