| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…fields PyObject_GC_New() only initialises the object header. All other fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs.
- Prepare memory allocations and new objects before calling PyObject_GC_New() - Initialise all fields at once using a series of assignments only - Use error labels for clarity
There was a problem hiding this comment.
I think that it is enough to set output_buffer = NULL.
Sorry, something went wrong.
You also need to adjust _Unpickler_New(): The minimal solution is setting self->output_buffer = NULL and also for example self->stack = NULL in _Unpickler_New(). I still think this PR is better, since it makes for cleaner error handling and improved maintainability. I'm not going to push it, though; I can live with the minimal solution :) |
Sorry, something went wrong.
|
Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
|
Sorry, @erlend-aasland, I could not cleanly backport this to 3.11 due to a conflict. |
Sorry, something went wrong.
|
GH-105710 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
…fields (pythonGH-105686) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
…Object fields (python#105686) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
GH-105711 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
|
Thanks for the review! |
Sorry, something went wrong.
… fields (GH-105686) (#105710) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* main: pythongh-105540: Fix code generator tests (python#105707) pythongh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (python#105686) pythongh-105331: Change `asyncio.sleep` to raise ``ValueError` for nan (python#105641) Remove support for legacy bytecode instructions (python#105705)
… fields (#105686) (#105711) * [3.11] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (#105686) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
| Back | FazBrowse Home | New Git URL |
PyObject_GC_New() only initialises the object header. All other fields
must be explicitly initialised to prevent manipulation of uninitialised
fields in dealloc.
Align initialisation order with the layout of the object structs.