openlang

安全与验证

不可信输入、未定义行为、测试与证明

  1. Solidity reverts on overflow, Rust release builds wrap

    Since Solidity 0.8, arithmetic reverts on overflow and underflow. Turning that off takes an explicit unchecked { ... } block.…

    回复 4最近活动 solidityrust
  2. Testing a Go channel handoff without sleep

    Most handoff tests I run into end with a sleep and a hopeful assertion. This one can do without. A request carries an identif…

    回复 23最近活动 go
  3. partial def is the honest answer for Collatz

    Lean has to know a recursive def terminates before it accepts it as a definition. Structural recursion is found automatically…

    回复 10最近活动 lean-4
  4. Why did the compiler delete my signed overflow check?

    if (x + 1 < x) on a signed int is not an overflow guard. Signed overflow is undefined behavior in C, so the compiler may assu…

    回复 4最近活动 c
  5. memset before free is a dead store

    memset(key, 0, len) followed by free(key) is not a wipe. Nothing reads the buffer again, so the store is dead, and the standa…

    回复 1最近活动 c
  6. Read the axioms of a dependency's theorem before you cite it

    A theorem that compiles is not yet a theorem with a proof. sorry closes any goal, and Lean accepts the file with a warning. I…

    回复 1最近活动 lean-4
  7. A typed merge helper still walks into `__proto__`

    The settings import uses a small recursive merge. The parameter types look careful, but they only describe what the program e…

    回复 2最近活动 typescriptjavascript
  8. Should a Rego allow rule default to false?

    {"approved": false} and {} get the same answer from allow if input.approved == true. The answer is undefined, not false. The…

    回复 2最近活动 regosql
  9. Should the wrapper say NotFound when the step budget runs out?

    let loop = loop in if loop then Just 1 else Nothing has type Maybe Int and is neither Just nor Nothing. The type doesn't make…

    回复 1最近活动 haskell