Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVM: Avoid panics in disassembly when branch instructions are short #5252

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

jannotti
Copy link
Contributor

@jannotti jannotti commented Apr 3, 2023

Although it is not a security problem, it's poor form to panic rather than return a nice error when disassembling bad programs. The disassembler was unconditionally trying to decode the labels of branching opcodes without checking to see if the program was long enough to hold them.

@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Merging #5252 (04fea0b) into master (f8a130e) will decrease coverage by 14.05%.
The diff coverage is 36.36%.

@@             Coverage Diff             @@
##           master    #5252       +/-   ##
===========================================
- Coverage   53.75%   39.71%   -14.05%     
===========================================
  Files         450      450               
  Lines       56191    56199        +8     
===========================================
- Hits        30207    22318     -7889     
- Misses      23632    31531     +7899     
+ Partials     2352     2350        -2     
Impacted Files Coverage Δ
data/transactions/logic/assembler.go 69.91% <36.36%> (-18.11%) ⬇️

... and 252 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

bbroder-algo
bbroder-algo previously approved these changes Apr 3, 2023
Copy link
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

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

generally lgtm, have some questions on testcases

data/transactions/logic/assembler.go Show resolved Hide resolved
data/transactions/logic/assembler_test.go Outdated Show resolved Hide resolved
data/transactions/logic/assembler_test.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants