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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hemanth94
Copy link

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).

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
1 participant