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

fix: binary parser sometimes reads out of packet bounds when results … #2601

Merged
merged 1 commit into from Apr 18, 2024

Conversation

Parsonswy
Copy link
Contributor

@Parsonswy Parsonswy commented Apr 18, 2024

Fixes #2602.

Check the nullBitmaskByte before trying to readLengthCodedBuffer() when typeCast: false on binary results.

@sidorares
Copy link
Owner

sidorares commented Apr 18, 2024

thanks for fix PR and detailed report @Parsonswy ! Do you think it would be possible to include a unit test ( failing without lib/parsers/binary_parser.js changes and passing with )?

The main change looks good to me

Copy link

codecov bot commented Apr 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.32%. Comparing base (2129818) to head (40f9224).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2601   +/-   ##
=======================================
  Coverage   90.32%   90.32%           
=======================================
  Files          71       71           
  Lines       15725    15727    +2     
  Branches     1339     1339           
=======================================
+ Hits        14204    14206    +2     
  Misses       1521     1521           
Flag Coverage Δ
compression-0 90.32% <100.00%> (+<0.01%) ⬆️
compression-1 90.32% <100.00%> (+<0.01%) ⬆️
tls-0 89.85% <100.00%> (+<0.01%) ⬆️
tls-1 90.15% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Parsonswy
Copy link
Contributor Author

@sidorares Certainly. Test added.

@wellwelwel
Copy link
Collaborator

LGTM 🚀

@sidorares sidorares merged commit 705835d into sidorares:master Apr 18, 2024
64 checks passed
@Parsonswy Parsonswy deleted the fix/typecast-false-null-oob branch April 18, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants