BPO | [20515](https://bugs.python.org/issue20515) --- | :--- Nosy | @terryjreedy, @larryhastings, @tiran, @serhiy-storchaka Files | [cid1167595.patch](https://bugs.python.org/file33918/cid1167595.patch "Uploaded as text/plain at 2014-02-04.23:09:12 by @tiran") *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: ```python assignee = None closed_at = created_at = labels = ['expert-tkinter', 'type-crash', 'release-blocker'] title = 'Null pointer dereference in tkinter module' updated_at = user = 'https://github.com/tiran' ``` bugs.python.org fields: ```python activity = actor = 'serhiy.storchaka' assignee = 'none' closed = True closed_date = closer = 'serhiy.storchaka' components = ['Tkinter'] creation = 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
tiran commentedon Feb 4, 2014
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
1399 s = PyUnicode_AsUTF8AndSize(in, &size);
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) {
python-dev commentedon Feb 4, 2014
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
terryjreedy commentedon Feb 5, 2014
Is the fix needed for 2.7?
serhiy-storchaka commentedon Feb 10, 2014
No, in 2.7 varname converter doesn't accept unicode.
Good catch Christian.