Skip to content

Commit

Permalink
Fix possible string overflow in BTAdvertisedDeviceSet::toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev committed Apr 16, 2021
1 parent 41c372c commit 57cf2fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ std::string BTAdvertisedDeviceSet::toString() {
res += val;
}
if (haveRSSI()) {
char val[4];
snprintf(val, sizeof(val), "%d", getRSSI());
char val[6];
snprintf(val, sizeof(val), "%d", (int8_t)getRSSI());
res += ", rssi: ";
res += val;
}
Expand Down

0 comments on commit 57cf2fb

Please sign in to comment.