Skip to content

security: death tests proving library hardening fires #306

Closed

Description

@homer6

Tests (EXPECT_DEATH) that an out-of-bounds operator[], a bad optional/expected access, a span overrun, etc. abort under the hardened build, per standard library; skipped with the reason where a platform's library lacks the check. Feeds docs/security/hardening.md.

Part of #286. PR into dev-0.5, from a feature branch in its own worktree.

Activity

  1. self-assigned this
    on Nov 3, 2026
  2. homer6 commented on Nov 3, 2026

    @homer6
    OwnerAuthor

    Delivered in #329.

    What changed

    • tests/security/hardening_test.cpp: 8 death tests (vector/array/span/string/string_view index, empty front(), empty optional, expected with an error) plus an in-range control; they run when library hardening is active and skip with the reason otherwise.
    • docs/testing.md: one paragraph on them.

    Why

    • To prove, per standard library and platform, that the hardening switches stop out-of-bounds and empty accesses; checked on GCC 15 (hardened and default -O0), Clang 22 (hardened, plain skips) and GCC 16 hardened.

    Still open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

securityv0.5.0 security work

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions