Python GIL isn't reacquired when error is encountered

Bug #452195 reported by lorenz quack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python-Crypto
Fix Released
Undecided
Unassigned

Bug Description

This may not be considered a bug but I though I report it anyway.
In "ALG_Encrypt()" and "ALG_Decrypt()" there is a "switch(mode)" after releasing the GIL.
In the "default" section of those switches the GIL isn't reacquired but calls to Python are made specifically "PyErr_Format()".

The "default" section is only entered when there is an error in the internal state (unknown mode) but still I think the GIL should be reacquired.

A patch is appended.

Revision history for this message
lorenz quack (lorenz.quack) wrote :
Revision history for this message
Darsey Litzenberger (dlitz) wrote :

Agreed. If we're going to bother handling the default case at all, we should at least do it properly.

Fix committed:
http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.x.git;a=commitdiff;h=a7748d0e65fe17fbcb20f7b086536c3ccf68de43

Changed in pycrypto:
status: New → Fix Released
Changed in pycrypto:
milestone: none → 2.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.