Skip to content

gh-135241: Changed the opcode of _pickle module to look for 00 and 01 specifically #135242

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

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

Conversation

Legoclones
Copy link
Contributor

@Legoclones Legoclones commented Jun 8, 2025

The python pickle module looks for "00" and "01" but _pickle only looked for 2 characters that parsed to 0 or 1, meaning some payloads like "+0" or " 0" would lead to different results in different implementations. See more details in the linked issue.

This solution simply checks for the hard-coded chars ensuring no edge cases go by.

The python pickle module looks for "00" and "01" but _pickle only looked for 2 characters that parsed to 0 or 1, meaning some payloads like "+0" or " 0" would lead to different results in different implementations
skirpichev

This comment was marked as resolved.

@Legoclones Legoclones requested a review from skirpichev June 9, 2025 14:09
@serhiy-storchaka serhiy-storchaka self-requested a review June 9, 2025 18:41
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.

2 participants