fix(build): M-02 — enable overflow checks in release profile

This commit is contained in:
2026-09-19 09:12:30 +02:00
parent a502845662
commit ad9148d867
2 changed files with 18 additions and 0 deletions
+1
View File
@@ -54,3 +54,4 @@ lto = true
codegen-units = 1 codegen-units = 1
panic = "unwind" panic = "unwind"
strip = true strip = true
overflow-checks = true
+17
View File
@@ -1790,3 +1790,20 @@ async fn test_k03_passwd_sheet_remains_valid_and_rekey_revokes_old_sheet() {
// Aufräumen // Aufräumen
let _ = std::fs::remove_file(&container_path); let _ = std::fs::remove_file(&container_path);
} }
#[test]
fn test_m02_release_profile_enables_overflow_checks() {
let cargo_toml = std::fs::read_to_string("Cargo.toml").expect("Read Cargo.toml");
let release_section = cargo_toml
.split("[profile.release]")
.nth(1)
.expect("Must have [profile.release] section");
let release_block = release_section
.split('[')
.next()
.unwrap_or(release_section);
assert!(
release_block.contains("overflow-checks = true"),
"M-02: [profile.release] must explicitly set overflow-checks = true to prevent integer overflow vulnerabilities"
);
}