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.
11 lines
345 B
C
11 lines
345 B
C
// CWE-476: null pointer dereference (unchecked malloc/argv pointer).
|
|
#include <stdlib.h>
|
|
__attribute__((noinline)) int vuln(int* p) {
|
|
return *p; // sink: deref of possibly-null p
|
|
}
|
|
int main(int argc, char** argv) {
|
|
int* p = 0;
|
|
if (argc > 1)
|
|
p = (int*)argv; // attacker-controlled, may be null in tests
|
|
return vuln(p);
|
|
}
|