Skip to content

TLV file crash #4

@SoorajDe

Description

@SoorajDe

Summary

Running sigflow validate on a malformed TLV file crashes instead of returning warnings/diagnostics.

Reproduction

Run: python -m sigflow validate samples\malformed_frame.sgf
Smallest failing input (fixture): samples\malformed_frame.sgf

Expected Behavior

validate should not crash.
It should return diagnostics (warnings) like it does for other bad fixtures.
For ex: it should print frames=... diagnostics=... and exit cleanly.

Actual Behavior

The program crashes with:

sigflow.core.exceptions.ParseError: truncated input

Root cause

-TLVParser tries to read: value bytes for each TLV.
-If the file is cut short (truncated), it asks for bytes that don’t exist.
-The helper require() then raises ParseError("truncated input").
-That ParseError is not converted into a “warning/diagnostic”, so the whole command crashes.

Environment

  • Python version: Python 3.10.11
  • sigflow version or commit:
  • Operating system: windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions