Skip to content

Top-level integer decode traps on empty token #326

Description

@dduan

Fuzzing found a crash with this input:

-=0

Minimal repro:

try TOMLDecoder().decode(Int.self, from: "-=0\n")

Expected: decoding throws.
Actual: integer unpacking can trap because the top-level keyed document leaves the decoder with Token.empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions