tests, docs: simplify OnceLock usage in Linux sandbox tests, update Java patterns in rules documentation

This commit is contained in:
elipeter 2026-06-03 11:36:52 -05:00
parent eb4332edb5
commit 7468d2214b
2 changed files with 3 additions and 4 deletions

View file

@ -121,7 +121,7 @@ The tables below are generated from `src/patterns/<lang>.rs` by [`tools/docgen`]
| `go.crypto.md5` | Low | A | Medium |
| `go.crypto.sha1` | Low | A | Medium |
### Java: 10 patterns
### Java: 9 patterns
| Rule ID | Severity | Tier | Confidence |
|---|---|---|---|
@ -129,12 +129,11 @@ The tables below are generated from `src/patterns/<lang>.rs` by [`tools/docgen`]
| `java.code_exec.text4shell_interpolator` | High | A | High |
| `java.deser.readobject` | High | A | High |
| `java.deser.snakeyaml_unsafe_constructor` | High | A | High |
| `java.crypto.weak_algorithm` | Medium | A | Medium |
| `java.reflection.class_forname` | Medium | A | High |
| `java.reflection.method_invoke` | Medium | A | High |
| `java.sqli.execute_concat` | Medium | B | Medium |
| `java.xss.getwriter_print` | Medium | A | High |
| `java.crypto.insecure_random` | Low | A | Medium |
| `java.crypto.weak_digest` | Low | A | Medium |
### JavaScript: 22 patterns

View file

@ -43,7 +43,7 @@ mod hardening_tests {
static PROBE_BINARY: OnceLock<Option<PathBuf>> = OnceLock::new();
fn probe_path() -> Option<&'static Path> {
PROBE_BINARY.get_or_init(|| build_probe_once()).as_deref()
PROBE_BINARY.get_or_init(build_probe_once).as_deref()
}
fn build_probe_once() -> Option<PathBuf> {