[New-bugs-announce] [issue3954] _hotshot: invalid error control in logreader()
STINNER Victor
report at bugs.python.org
Wed Sep 24 12:02:33 CEST 2008
New submission from STINNER Victor <victor.stinner at haypocalc.com>:
Using Fusil the fuzzer, I found a "minor" bug in _hotshot module: it
doesn't check correctly the errors in hotshot_logreader(). On error,
an exception is raised (eg. by eof_error()) but the result is a
pointer to a new allocated object instead of NULL.
Here is a patch to delete the new created object (using Py_DECREF) and
return NULL. It uses an ugly goto, but goto is sometimes useful to
avoid code duplication on error handling (eg. see Linux source code).
Example to reproduce the bug:
---
import _hotshot, gc
_hotshot.logreader(".")
gc.collect()
---
----------
components: Library (Lib)
files: _hotshot_logreader.patch
keywords: patch
messages: 73700
nosy: haypo
severity: normal
status: open
title: _hotshot: invalid error control in logreader()
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file11589/_hotshot_logreader.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3954>
_______________________________________
More information about the New-bugs-announce
mailing list