[New-bugs-announce] [issue23998] PyImport_ReInitLock() doesn't check for allocation error

Christian Heimes report at bugs.python.org
Sun Apr 19 00:42:35 CEST 2015


New submission from Christian Heimes:

_PyImport_ReInitLock() doesn't check the return value of PyThread_allocate_lock(). A failed lock allocation can either lead to a NULL pointer dereference or to race conditions caused by a missing import lock.

As there is no way to recover from a failed lock allication I recommend to abort with a fatal error.

CID 1295025 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer import_lock to PyThread_acquire_lock, which dereferences it.

----------
files: import_reinit_fatal.patch
keywords: buildbot, easy, patch
messages: 241462
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: PyImport_ReInitLock() doesn't check for allocation error
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file39110/import_reinit_fatal.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23998>
_______________________________________


More information about the New-bugs-announce mailing list