Skip to content

add check for daglen exaggeration - #350

Merged
apoelstra merged 1 commit into
BlockstreamResearch:masterfrom
stringhandler:st-fix-dag-alloc
Oct 15, 2026
Merged

apoelstra merged 1 commit into
BlockstreamResearch:masterfrom
stringhandler:st-fix-dag-alloc

Conversation

@stringhandler

Copy link
Copy Markdown
Collaborator

When decoding a simplicity program, the dag length is read first. Currently, we allocate memory according to that length without checking whether the program is actually that long. This could be used to allocate more memory than needed. Here we add a check that the length of the DAG on stream is within the size of that length before allocating.

When decoding a simplicity program, the dag length is read first. Currently, we 
allocate memory according to that length without checking whether the program 
is actually that long. This could be used to allocate more memory than needed.
Here we add a check that the length of the DAG on stream is within the size of 
that length before allocating.
@stringhandler

Copy link
Copy Markdown
Collaborator Author

Related to #125

Comment thread .gitignore
/*.c
/*.h
/*.inc
.vscode No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 6a93c45:

I'll allow this since we already have piles of tool-specific stuff in here but this really ought to go in your .git/info/exclude rather than the project-wide gitignore.

@apoelstra

Copy link
Copy Markdown
Collaborator

Overall this looks great to me. It's much stronger than any of the suggested "fixes" we've gotten from the multiple LLM reports duplicating #125, and should hopefully shut up future reports of that issue.

@apoelstra apoelstra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 6a93c45; successfully ran local tests

@apoelstra
apoelstra merged commit aaeda46 into BlockstreamResearch:master Oct 15, 2026
14 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