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

Use Py_XDECREF() instead of Py_DECREF() in MultibyteCodec and MultibyteStreamReader #47555

Closed
vstinner opened this issue Jul 6, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@vstinner
Copy link
Member

vstinner commented Jul 6, 2008

BPO 3305
Nosy @birkenfeld, @vstinner
Files
  • multibytecodec_py_xdecref.patch: Patch to fix described bugs
  • 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 2008-07-16.22:04:28.885>
    created_at = <Date 2008-07-06.18:27:38.886>
    labels = ['library']
    title = 'Use Py_XDECREF() instead of Py_DECREF() in MultibyteCodec and MultibyteStreamReader'
    updated_at = <Date 2008-07-16.22:04:28.883>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2008-07-16.22:04:28.883>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-07-16.22:04:28.885>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2008-07-06.18:27:38.886>
    creator = 'vstinner'
    dependencies = []
    files = ['10834']
    hgrepos = []
    issue_num = 3305
    keywords = ['patch']
    message_count = 2.0
    messages = ['69347', '69844']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3305'
    versions = ['Python 2.6']

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 6, 2008

    Functions mbstreamwriter_dealloc() and mbstreamreader_dealloc() of
    Modules/cjkcodecs/multibytecodec.c uses Py_DECREF() to free stream
    attribute memory, but this attribute may be NULL if MultibyteCodec or
    MultibyteStreamReader constructor fails.

    Simple fix: use Py_XDECREF().

    Example:
    >>> import _multibytecodec
    >>> _multibytecodec.MultibyteStreamReader(None)
    Erreur de segmentation (core dumped)

    @vstinner vstinner added the stdlib Python modules in the Lib dir label Jul 6, 2008
    @birkenfeld
    Copy link
    Member

    Fixed in r65038.

    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants