Skip to content

Fix frame bounds checks for malformed handles and values - #26

Merged
tbybell merged 2 commits into
gtkwave:mainfrom
Rodrigodd:upstream/frame-bounds-checks
Oct 18, 2026
Merged

tbybell merged 2 commits into
gtkwave:mainfrom
Rodrigodd:upstream/frame-bounds-checks

Conversation

@Rodrigodd

Copy link
Copy Markdown
Contributor

Problem: A frame can claim more handles than the file has, causing out-of-bounds accesses. Value offsets can also exceed the frame length, with real values potentially reading eight bytes despite a smaller declared width. The RVAT path does not retain the frame length for equivalent checks.

Solution: Reject frames with too many handles and validate each value against the frame length using its actual read size. Store the RVAT frame length for the same validation. Also reset chain_cmem after freeing it when abandoning a section.

AI-assisted

Problem: A frame can claim more handles than the file has, causing
out-of-bounds accesses. Value offsets can also exceed the frame length,
with real values potentially reading eight bytes despite a smaller
declared width. The RVAT path does not retain the frame length for
equivalent checks.

Solution: Reject frames with too many handles and validate each value
against the frame length using its actual read size. Store the RVAT
frame length for the same validation. Also reset `chain_cmem` after
freeing it when abandoning a section.

AI-assisted
@tbybell
tbybell merged commit f143273 into gtkwave:main Oct 18, 2026
3 checks passed
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.

2 participants