Issue 9834: PySequence_GetSlice() lacks a NULL check (original) (raw)

Issue9834

Created on 2010-09-11 11:24 by scoder, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg116092 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2010-09-11 11:24
PySequence_GetSlice() in Objects/abstract.c contains the following code: mp = s->ob_type->tp_as_mapping; if (mp->mp_subscript) { This crashes when the type's "tp_as_mapping" is NULL. The obvious fix is to simply write if (mp && mp->mp_subscript) as basically everywhere else around that function. The problem seems to have occurred during a rewrite for Python 3, it's ok in the 2.x series.
msg116105 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-09-11 16:02
r84714
History
Date User Action Args
2022-04-11 14:57:06 admin set github: 54043
2010-09-11 16:02:21 benjamin.peterson set status: open -> closednosy: + benjamin.petersonmessages: + resolution: fixed
2010-09-11 11:24:44 scoder create