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.
13 lines
367 B
C
13 lines
367 B
C
// CWE-121: stack buffer overflow (strcpy into fixed 64-byte buffer).
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
__attribute__((noinline)) void vuln(const char* src) {
|
|
char buf[64];
|
|
strcpy(buf, src); // sink: unbounded copy -> stack BOF
|
|
write(1, buf, sizeof(buf));
|
|
}
|
|
int main(int argc, char** argv) {
|
|
if (argc > 1)
|
|
vuln(argv[1]);
|
|
return 0;
|
|
}
|