fold/tests/fixtures/binary/cwe/clean.c
trvon fd4a68dfff
test: add coverage for project graph, pcode encoder, and detector behaviors
Unit + integration coverage for the session's work: incremental project
graph/index, pcode encoder, unreachable/dead-branch, equiv/cross-TU,
div-by-zero/sign-conversion/int-truncation, use-after-free, quality-precision,
scan-router profile, source TU runner, detector plan, and the eval fixtures.
2026-08-16 16:46:07 -06:00

14 lines
356 B
C

// Clean negative control: no vulnerability.
#include <string.h>
#include <unistd.h>
__attribute__((noinline)) void ok(const char* src) {
char buf[64];
strncpy(buf, src, sizeof(buf) - 1); // bounded, safe
buf[63] = '\0';
write(1, buf, sizeof(buf));
}
int main(int argc, char** argv) {
if (argc > 1)
ok(argv[1]);
return 0;
}