[issue3321] _multiprocessing.Connection() doesn't check handle

STINNER Victor report at bugs.python.org
Wed Jul 9 00:45:10 CEST 2008


New submission from STINNER Victor <haypo at users.sourceforge.net>:

_multiprocessing.Connection() allows to use any positive (or nul) 
number has socket handle. If you use an invalid file descriptor, 
poll() method may crash (especially for big positive integer). 
Example:

>>> import _multiprocessing
>>> obj = _multiprocessing.Connection(44977608)
>>> obj.poll()
Erreur de segmentation (core dumped)

Fix: use fstat() to make sure that the handle is valid. Attached patch 
implements this feature.

Another solution would be to reuse code from Modules/selectmodule.c.

----------
components: Library (Lib)
files: _multiprocessing_connection.patch
keywords: patch
messages: 69446
nosy: haypo
severity: normal
status: open
title: _multiprocessing.Connection() doesn't check handle
versions: Python 2.6
Added file: http://bugs.python.org/file10860/_multiprocessing_connection.patch

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


More information about the Python-bugs-list mailing list