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: do not allow non C-contiguous buffer #667

Merged
merged 1 commit into from
Jan 1, 2024
Merged

Conversation

mayeut
Copy link
Owner

@mayeut mayeut commented Jan 1, 2024

They were not allowed in the C-extension but given a bug exists in PyPy, they could be accepted and return the wrong result.
Add a workaround for the PyPy bug and disallow non C-contiguous buffer in the pure python fallback implementation.
The encodebytes buffer check is also a bit stricter in the C-extension to mimic CPython behavior.

They were not allowed in the C-extension but given a bug exists in PyPy, they could be accepted and return the wrong result.

Add a workaround for the PyPy bug and disallow non C-contiguous buffer in the pure python fallback implementation.

The `encodebytes` buffer check is also a bit stricter in the C-extension to mimic CPython behavior.
Copy link

codecov bot commented Jan 1, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (7446ef0) 93.18% compared to head (1674a3a) 93.57%.

Files Patch % Lines
src/pybase64/_pybase64.c 86.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #667      +/-   ##
==========================================
+ Coverage   93.18%   93.57%   +0.39%     
==========================================
  Files           8        8              
  Lines        1012     1059      +47     
  Branches      272      285      +13     
==========================================
+ Hits          943      991      +48     
+ Misses         36       35       -1     
  Partials       33       33              

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

@mayeut mayeut merged commit 506da18 into master Jan 1, 2024
42 checks passed
@mayeut mayeut deleted the discard-non-contiguous branch January 1, 2024 10:10
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.

1 participant