| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Reject size larger than the allocated size. Also, check negative size in PyBytesWriter_FinishWithSize() to always raise ValueError. Previously, the function raised SystemError or ValueError depending on the code path. Replace _PyBytesWriter_GetAllocated() optimization with _PyBytesWriter_ResizeToAllocated() to update the writer size to its allocated size.
|
Currently, if PyBytesWriter_FinishWithSize() size is larger than the writer size, it reads uninitialized memory (which can lead to a segfault) which is bad. |
Sorry, something went wrong.
test_capi: only run the 3 "example" tests in BytesWriterTest. There is no need to rerun the same tests in ByteArrayWriterTest.
FinishWithSize() already checks the size.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
|
Sorry, @vstinner, I could not cleanly backport this to 3.15 due to a conflict. cherry_picker 4e530b82f37ec89e3b54bc5d0a1612c643bff1e0 3.15 |
Sorry, something went wrong.
|
There are conflicts on the 3.15 backport. Some recent PyBytesWriter changes are not backported to 3.15 yet. I will backport this change when the 3.15 branch will be unblocked (after 3.15.0 final release). |
Sorry, something went wrong.
…#157226) Reject size larger than the allocated size. Check also negative size in PyBytesWriter_FinishWithSize() to always raise ValueError. Previously, the function raised SystemError or ValueError depending on the code path. Replace _PyBytesWriter_GetAllocated() optimization with _PyBytesWriter_ResizeToAllocated() to update the writer size to its allocated size. test_capi: only run the 3 "example" tests in BytesWriterTest. There is no need to rerun the same tests in ByteArrayWriterTest.
…#157226) Reject size larger than the allocated size. Check also negative size in PyBytesWriter_FinishWithSize() to always raise ValueError. Previously, the function raised SystemError or ValueError depending on the code path. Replace _PyBytesWriter_GetAllocated() optimization with _PyBytesWriter_ResizeToAllocated() to update the writer size to its allocated size. test_capi: only run the 3 "example" tests in BytesWriterTest. There is no need to rerun the same tests in ByteArrayWriterTest.
| Back | FazBrowse Home | New Git URL |
Reject size larger than the allocated size.
Also, check negative size in PyBytesWriter_FinishWithSize() to always raise ValueError. Previously, the function raised SystemError or ValueError depending on the code path.
Replace _PyBytesWriter_GetAllocated() optimization with _PyBytesWriter_ResizeToAllocated() to update the writer size to its allocated size.