Commit 60d9219
fix(assail): null-check-aware UncheckedAllocation + precise eval detectors (#134)
Three **precision fixes** to the `assail` analyzers that produced false
positives across the estate — found while triaging
hyperpolymath/proven#68 and JoshuaJewell/paint-type#86, and the root
cause of why genuine fixes didn't clear. All conservative: **no new
false negatives**.
## 1. UncheckedAllocation is now actually "unchecked"-aware (C)
The detector flagged **every** `malloc(...)` regardless of a NULL check,
and emitted a *line-less, file-level* finding. Now it:
- scans per line and **skips a malloc whose result is NULL-checked**
within a short window (`if (p == NULL)`, `if (!p)`, `nullptr`);
- attaches a **line number** — which also lets an inline `//
panic-attack: accepted` marker suppress a reviewed site (previously
impossible: marker suppression is line-gated).
This is precisely why a real null-check fix (proven `stubs.c`) never
cleared before.
## 2. eval() detectors are word-boundary aware (JS / Python)
`contains("eval(")` matched FFI symbol names like
`proven_calculator_eval(`. Now `\beval\s*\(` (and `\b(?:eval|exec)\s*\(`
for Python). Genuine `eval(` still flagged.
## 3. Shell `eval` no longer matches the `--eval` CLI flag
`contains("eval ")` matched `--eval`. Now the eval builtin is matched
only in statement position — `(?m)(?:^|[\s;&|(])eval[ \t]`.
`--eval`/`-eval` no longer flagged; the real shell `eval` builtin still
is.
## Verification
- 4 new tests (`tests/analyzer_tests.rs`): null-checked malloc skipped;
genuinely-unchecked still flagged; shell `--eval` flag not flagged but
builtin is; FFI `*_eval(` not flagged but real `eval()` is.
- Full analyzer suite **17/17 green**, zero warnings.
- **End-to-end**: rebuilt 2.5.5 and re-scanned —
- **proven**: 1 → **0** active Critical/High (`stubs.c` clears; the
genuine fix finally registers).
- **paint-type**: 36 → **35** (the gossamer `--eval` benchmark FP
clears; the 3 irreducible `believe_me` axioms + 32 genuinely-unsafe
vendored Zig FFI **correctly remain** — no over-suppression).
Refs #32, hyperpolymath/proven#68.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 926c507 commit 60d9219
2 files changed
Lines changed: 201 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
| |||
259 | 262 | | |
260 | 263 | | |
261 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
262 | 318 | | |
263 | 319 | | |
264 | 320 | | |
| |||
1662 | 1718 | | |
1663 | 1719 | | |
1664 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
1665 | 1727 | | |
1666 | 1728 | | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | | - | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
1679 | 1744 | | |
1680 | 1745 | | |
1681 | 1746 | | |
| |||
2035 | 2100 | | |
2036 | 2101 | | |
2037 | 2102 | | |
2038 | | - | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
2039 | 2108 | | |
2040 | 2109 | | |
2041 | 2110 | | |
| |||
2234 | 2303 | | |
2235 | 2304 | | |
2236 | 2305 | | |
2237 | | - | |
2238 | | - | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
2239 | 2312 | | |
2240 | 2313 | | |
2241 | 2314 | | |
| |||
4475 | 4548 | | |
4476 | 4549 | | |
4477 | 4550 | | |
4478 | | - | |
4479 | | - | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
4480 | 4558 | | |
4481 | 4559 | | |
4482 | 4560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
0 commit comments