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.
14 lines
356 B
C
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;
|
|
}
|