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: Checking overflow in Sliced function #21207

Merged
merged 3 commits into from
Feb 15, 2025
Merged

Conversation

hemanth94
Copy link
Contributor

Fixes #20239
This issue happens in release mode when integer overflow is wrapped.

We can use checked_add function of usize to check for overflow in release mode without letting it wrap.
Using expect, lets the code panic fulfilling the assertion.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.88%. Comparing base (f69768d) to head (978e45f).
Report is 33 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21207      +/-   ##
==========================================
- Coverage   79.88%   79.88%   -0.01%     
==========================================
  Files        1593     1593              
  Lines      227803   227806       +3     
  Branches     2600     2600              
==========================================
- Hits       181989   181983       -6     
- Misses      45217    45226       +9     
  Partials      597      597              

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

@hemanth94 hemanth94 changed the title Fix(rust): Checking overflow in Sliced function fix (rust): Checking overflow in Sliced function Feb 12, 2025
@ritchie46 ritchie46 changed the title fix (rust): Checking overflow in Sliced function fix(rust): Checking overflow in Sliced function Feb 15, 2025
@github-actions github-actions bot added fix Bug fix rust Related to Rust Polars and removed title needs formatting labels Feb 15, 2025
@ritchie46 ritchie46 changed the title fix(rust): Checking overflow in Sliced function fix: Checking overflow in Sliced function Feb 15, 2025
@ritchie46 ritchie46 merged commit adcfdce into pola-rs:main Feb 15, 2025
23 of 26 checks passed
@github-actions github-actions bot added the python Related to Python Polars label Feb 15, 2025
@hemanth94 hemanth94 deleted the tes2 branch February 15, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sliced() function on polars-arrow Array is unsound, allows out-of-bounds access in release mode
2 participants