Skip to content

Fix: recoverable diagnostics for truncated TLV value#14

Merged
jmestwa-coder merged 1 commit into
jmestwa-coder:mainfrom
SoorajDe:tlv-only
May 26, 2026
Merged

Fix: recoverable diagnostics for truncated TLV value#14
jmestwa-coder merged 1 commit into
jmestwa-coder:mainfrom
SoorajDe:tlv-only

Conversation

@SoorajDe

Copy link
Copy Markdown
Contributor

Fix:
sigflow/parsers/tlv.py now treats truncated TLV values (header parsed, but declared value length exceeds remaining bytes) as recoverable diagnostics instead of raising a hard ParseError.

Behavior:

  • emits context.warn("tlv-truncated", ...)
  • stops parsing gracefully via break

Tests:

  • added regression coverage in tests/test_parsers.py

  • verifies truncated TLV input:

    • does not raise ParseError
    • emits tlv-truncated diagnostic

Validation:

  • pytest -q
  • all tests passing (12 total)

@jmestwa-coder

Copy link
Copy Markdown
Owner

This PR is related to issue #4 and also connected to PR #12.

@jmestwa-coder

Copy link
Copy Markdown
Owner

@SoorajDe

LGTM, Merging.

@jmestwa-coder jmestwa-coder merged commit 8997d00 into jmestwa-coder:main May 26, 2026
3 checks passed
@jmestwa-coder

Copy link
Copy Markdown
Owner

@SoorajDe, Thank you for your contribution.

The submitted fix has been reviewed and merged successfully. You have successfully completed this evaluation task and have been shortlisted for the next round of the selection process.

Please send the following details to shortlist@digiscrypt.com for verification purposes:

Pull Request link
Merged commit link

@jmestwa-coder jmestwa-coder linked an issue May 26, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TLV file crash

2 participants