classification
Title: bogus NULL check in PyCapsule
Type: Stage:
Components: Interpreter Core Versions: Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, bkramer
Priority: normal Keywords: patch

Created on 2009-06-28 09:34 by bkramer, last changed 2009-06-28 16:24 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
capsulecompare.patch bkramer, 2009-06-28 09:34 proposed patch
Messages (2)
msg89769 - (view) Author: Benjamin Kramer (bkramer) Date: 2009-06-28 09:34
Objects/capsule.c contains the following code:

if (!name1 || !name2) {
    /* they're only the same if they're both NULL. */
    return name2 == name2;
}

The result of this comparison will always be true. The comment says it 
should be 'name1 == name2'.
msg89777 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-06-28 16:24
Thanks for the patch! Fixed in r73618.
History
Date User Action Args
2009-06-28 16:24:15benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg89777

resolution: fixed
2009-06-28 09:34:36bkramercreate