fold/tests/fixtures/organic/libssh2_cve_2019_17498_fixed.cpp
trvon 2dcbdbc75d
feat: harden Fold quality guard
Preserve source, binary, and runtime evidence boundaries while making precision and performance regressions reproducible.

- decompose analysis orchestration into bounded modules
- add differential, metamorphic, organic, and Yams change-time gates
- fix detector, P-Code, fuzz sanitizer, and report identity precision
2026-07-13 15:05:35 -04:00

16 lines
470 B
C++

// Adapted fixed counterpart for libssh2 revision
// 1c6fa92b77e34d089493fe6d3e2c6c8775858b94. The upstream patch moved
// parsing into checked helpers; this slice makes their length precondition explicit.
#include <cstddef>
bool acceptsPacket(std::size_t message_len, std::size_t datalen) {
if (datalen < 13)
return false;
if (message_len < datalen - 13)
return false;
return true;
}
int main() {
return acceptsPacket(1, 4) ? 0 : 1;
}