Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bogus NULL check in PyCapsule #50604

Closed
bkramer mannequin opened this issue Jun 28, 2009 · 2 comments
Closed

bogus NULL check in PyCapsule #50604

bkramer mannequin opened this issue Jun 28, 2009 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@bkramer
Copy link
Mannequin

bkramer mannequin commented Jun 28, 2009

BPO 6355
Nosy @benjaminp
Files
  • capsulecompare.patch: proposed patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-06-28.16:24:15.768>
    created_at = <Date 2009-06-28.09:34:36.357>
    labels = ['interpreter-core']
    title = 'bogus NULL check in PyCapsule'
    updated_at = <Date 2009-06-28.16:24:15.755>
    user = 'https://bugs.python.org/bkramer'

    bugs.python.org fields:

    activity = <Date 2009-06-28.16:24:15.755>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-06-28.16:24:15.768>
    closer = 'benjamin.peterson'
    components = ['Interpreter Core']
    creation = <Date 2009-06-28.09:34:36.357>
    creator = 'bkramer'
    dependencies = []
    files = ['14375']
    hgrepos = []
    issue_num = 6355
    keywords = ['patch']
    message_count = 2.0
    messages = ['89769', '89777']
    nosy_count = 2.0
    nosy_names = ['benjamin.peterson', 'bkramer']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue6355'
    versions = ['Python 3.1']

    @bkramer
    Copy link
    Mannequin Author

    bkramer mannequin commented Jun 28, 2009

    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'.

    @bkramer bkramer mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 28, 2009
    @benjaminp
    Copy link
    Contributor

    Thanks for the patch! Fixed in r73618.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant