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.
10 lines
291 B
C
10 lines
291 B
C
// CWE-369: divide by zero (divisor from argv, no check).
|
|
#include <stdlib.h>
|
|
__attribute__((noinline)) int vuln(int d) {
|
|
return 100 / d; // sink: division by attacker-controlled d
|
|
}
|
|
int main(int argc, char** argv) {
|
|
if (argc > 1)
|
|
return vuln(atoi(argv[1]));
|
|
return 0;
|
|
}
|