-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix #99 failing with overflow exeptions We want to force the decoder to attempt to allocate array string and byte buffers smaller than `sys.maxsize` but still far larger than anyone could have in their machine. It also needs to be aware of the native pointer size where the test runs. * Check that decoded lengths make sense * Fix bounds checks in C decoder * Remove it from decode bytestring, since the PyBytes_FromStringAndSize checks the bounds for us * Add it in to decode definite string since it allocates a temporary buffer of its own. * Further error checking around indefinite data string and byte chunks within an indefinite string or bytestring should not be indefinite themselves * Fix flake8 nits * Fix system errors by exiting out of indefinite loop when there's an error * Use Py_ssize_t everywhere it makes sense This makes handling unsigned long long lengths a bit more complicated but it is now consistent between 32 and 64 bit platforms. Also, all exceptions that make reference to lengths should be using Hexadecimal. Reference used to fix comparisons here: https://wiki.sei.cmu.edu/confluence/display/c/INT18-C.+Evaluate+integer+expressions+in+a+larger+size+before+comparing+or+assigning+to+that+size * Don't raise an error for large map size (c-lib consistency)
- Loading branch information
Showing
4 changed files
with
125 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters