stackless-dev / stackless

The Stackless Python programming language
http://www.stackless.com/
Other
1.03k stars 60 forks source link

invalid arguments for _stackless._wrap.frame.__setstate__() cause segfault in frame_dealloc() line "Py_DECREF(f->f_globals);" #269

Closed akruis closed 3 years ago

akruis commented 3 years ago

I found a crasher. Calling _stackless._wrap.frame.__setstate__() (C-function frame_setstate()) with invalid arguments leads to a NULL pointer access later on.

frame_setstate() clears f->f_globals and later sets f->f_globals to a new value. If frame_setstate() fails between this points, f->f_globals is NULL and this is not expected by frame_dealloc(). The fix is trivial.

akruis commented 3 years ago

Fixed.