-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
xdrlib fails to detect overflow (struct bug?) #45864
Comments
The XDR format requires integers to fit into 4 byte values. However (at An example on an x86-64 machine (Python 2.4.3) of encoding 2**32 (which $ ./xdr.py
4294967296 -> 00000000 -> 0 An example of struct itself not detecting overflow: >>> struct.pack("!I", 2**32)
'\x00\x00\x00\x00' struct.pack will only throw an overflow error if a value >= 2**64 is |
On trunk, I get the described struct behavior with " DeprecationWarning: On py3k, both raise "struct.error: argument out of range". Tested on Linux ia32. |
I'll take a look. |
I think there's nothing we can do about this in 2.6: there's probably code However, 2.6 should have been issuing DeprecationWarnings for overflow |
The deprecated overflow wrapping has been removed from trunk in r73891. I'd really like to remove the deprecated float coercion from trunk too, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: