mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-02 02:39:30 +00:00
fix: buffer overflow, OOB read, packet leaks, BLE sign leak, USB timeout, atomics, fs_read checks
- RegionMap::findMatch(): fix 1-byte stack overflow in tmp[] with bounded memcpy - Packet::readFrom(): add bounds checks before reading transport codes - Mesh::sendFlood(): release packet on TRACE type and invalid hash_size early returns - CompanionMesh: add cleanupSignState() called from BLE disconnect to free sign buffer - ZephyrCompanionUSB: add 2s timeout for partial V3 frames to prevent parser stall - ui_mesh_actions: replace volatile bool with Zephyr atomic_t for cross-thread state - CommonCLI: wrap ~40 fs_read() calls in prefs_read() helper with truncation warning
This commit is contained in:
@@ -150,9 +150,10 @@ RegionEntry* RegionMap::findMatch(mesh::Packet* packet, uint8_t mask) {
|
||||
_store->getAutoKeyFor(region->id, region->name, keys[0]);
|
||||
num = 1;
|
||||
} else { // new: implicit auto hashtag region
|
||||
char tmp[sizeof(region->name)];
|
||||
char tmp[sizeof(region->name) + 1];
|
||||
tmp[0] = '#';
|
||||
strcpy(&tmp[1], region->name);
|
||||
memcpy(&tmp[1], region->name, sizeof(region->name) - 1);
|
||||
tmp[sizeof(region->name)] = '\0';
|
||||
_store->getAutoKeyFor(region->id, tmp, keys[0]);
|
||||
num = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user