Skip to content

Reject integer overflow while parsing environment values #424

Closed

Description

@LunaStev

Summary

_env_parse_i64 accumulates digits with value * 10 + digit without checking the signed 64-bit range. Out-of-range environment values can therefore overflow instead of returning an error.

Relevant code

  • std/env/parse.wave
  • std/env/environ.wave

Scope

Add explicit overflow detection for positive and negative inputs, including the asymmetric i64::MIN boundary. Keep env_get_i64 and env_get_i32 returning an unsuccessful EnvResult for invalid input.

Acceptance criteria

  • Decimal i64 minimum and maximum values parse successfully.
  • Values one step outside either boundary are rejected.
  • Leading + and - retain their current behavior.
  • Empty, sign-only, and non-decimal strings remain rejected.
  • env_get_i32 continues to reject values outside the signed 32-bit range.
  • Boundary regression cases are added to the test corpus.

Activity

  1. added
    bug
    good first issue
    needs testing
    on Aug 29, 2026
  2. self-assigned this
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions