[issue3557] Segfault in sha1
report at bugs.python.org
Fri Aug 15 04:39:35 CEST 2008
New submission from Matt Giuca <matt.giuca at gmail.com>:
Continuing the discussion from Issue 3552
r65676 makes changes to Modules/md5module.c and Modules/sha1module.c, to
allow them to read mutable buffers.
There's a segfault in sha1module if given 0 arguments. eg:
>>> import _sha1
Docs here suggest this should be OK:
This crashes on the Lib/test/test_hmac.py test case, but apparently
(according to Margin on issue 3552) none of the build bots see it
because they use libopenssl and completely bypass the _md5 and _sha1
modules. Also there are no direct test cases for either of these modules.
This is because new code in r65676 doesn't initialise a pointer to NULL.
Fixed in patch (as well as replaced tab with spaces for consistency, in
I strongly recommend that a) A "build bot" be made to use _md5 and _sha1
instead of OpenSSL (or they aren't running that code at all), AND/OR b)
Direct test cases be written for _md5 and _sha1.
Fixed crash on _sha1.sha1(), with no arguments, due to not initialising
Normalised indentation in md5module.c and sha1module.c.
components: Interpreter Core
title: Segfault in sha1
versions: Python 3.0
Added file: http://bugs.python.org/file11118/sha1.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list