mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
Fold the duplicated noise gate and inflate bookkeeping
One predicate for the noise offer and one place that allocates the session; the window is already zero from value initialization, so drop the second clearing pass. The RP2 backend reads the framework version from the define ESPHome already emits rather than a vendor header, the inflate counter moves into the test device helper, and the corrupt stream sweep takes a coarser stride for the same coverage.
This commit is contained in:
@@ -306,7 +306,8 @@ TEST(OtaInflate, CorruptStreamsNeverEscapeTheWindow) {
|
||||
// Flipped bytes and garbage; the sanitizers check the decoder stays in bounds
|
||||
auto s = std::make_unique<Session>();
|
||||
std::vector<uint8_t> bad(DEFLATED, DEFLATED + sizeof(DEFLATED));
|
||||
for (size_t i = 0; i < bad.size(); i += 3) {
|
||||
// A coarse, non-aligned stride: neighbouring offsets hit the same paths
|
||||
for (size_t i = 0; i < bad.size(); i += 29) {
|
||||
bad[i] ^= 0x5a;
|
||||
inflate_all(*s, bad.data(), bad.size(), 1040);
|
||||
bad[i] ^= 0x5a;
|
||||
|
||||
Reference in New Issue
Block a user