Skip to content

Null pointer dereference in tkinter module #64714

Closed

Description

@tiran
BPO 20515
Nosy @terryjreedy, @larryhastings, @tiran, @serhiy-storchaka
Files
  • cid1167595.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 2014-02-10.20:23:01.995>
    created_at = <Date 2014-02-04.23:09:12.493>
    labels = ['expert-tkinter', 'type-crash', 'release-blocker']
    title = 'Null pointer dereference in tkinter module'
    updated_at = <Date 2014-02-10.20:23:01.994>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2014-02-10.20:23:01.994>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-02-10.20:23:01.995>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2014-02-04.23:09:12.493>
    creator = 'christian.heimes'
    dependencies = []
    files = ['33918']
    hgrepos = []
    issue_num = 20515
    keywords = ['patch']
    message_count = 4.0
    messages = ['210276', '210279', '210282', '210863']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'larry', 'christian.heimes', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue20515'
    versions = ['Python 3.4']

    Activity

    1. tiran commented on Feb 4, 2014

      @tiran
      MemberAuthor

      varname_converter() doesn't check the return value of PyUnicode_AsUTF8AndSize() for NULL. The bug was introduced by http://hg.python.org/cpython/rev/321b714653e3 / issue bpo-20368

      1. returned_null: Function "PyUnicode_AsUTF8AndSize(PyObject *, Py_ssize_t *)" returns null (checked 28 out of 30 times).[show details]
      2. var_assigned: Assigning: "s" = null return value from "PyUnicode_AsUTF8AndSize(PyObject *, Py_ssize_t *)".
        1399 s = PyUnicode_AsUTF8AndSize(in, &size);
      3. Condition "size > 2147483647", taking false branch
        1400 if (size > INT_MAX) {
        1401 PyErr_SetString(PyExc_OverflowError, "string is too long");
        1402 return 0;
        1403 }
        CID 1167595 (Support "bpo-" in Misc/NEWS #1 of 1): Dereference null return value (NULL_RETURNS)6. dereference: Dereferencing a pointer that might be null "s" when calling "strlen(char const *)"
        1404 if (strlen(s) != size) {
    2. added
      type-crash
      on Feb 4, 2014
    3. python-dev commented on Feb 4, 2014

      python-devmannequin
      Mannequin

      New changeset d83ce3a2d954 by Christian Heimes in branch '3.3':
      Issue bpo-20515: Fix NULL pointer dereference introduced by issue bpo-20368
      http://hg.python.org/cpython/rev/d83ce3a2d954

      New changeset 145032f626d3 by Christian Heimes in branch 'default':
      Issue bpo-20515: Fix NULL pointer dereference introduced by issue bpo-20368
      http://hg.python.org/cpython/rev/145032f626d3

    4. terryjreedy commented on Feb 5, 2014

      @terryjreedy
      Member

      Is the fix needed for 2.7?

    5. serhiy-storchaka commented on Feb 10, 2014

      @serhiy-storchaka
      Member

      No, in 2.7 varname converter doesn't accept unicode.

      Good catch Christian.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      release-blockertopic-tkintertype-crash

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions