Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d33491e

Browse files
committed
Issue #20515: Fix NULL pointer dereference introduced by issue #20368
CID 1167595
1 parent 6068b6c commit d33491e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Core and Builtins
4545
Library
4646
-------
4747

48+
- Issue #20515: Fix NULL pointer dereference introduced by issue #20368.
49+
4850
- Issue #19186: Restore namespacing of expat symbols inside the pyexpat module.
4951

5052
- Issue #20426: When passing the re.DEBUG flag, re.compile() displays the

Modules/_tkinter.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,9 @@ varname_converter(PyObject *in, void *_out)
15681568
if (PyUnicode_Check(in)) {
15691569
Py_ssize_t size;
15701570
s = PyUnicode_AsUTF8AndSize(in, &size);
1571+
if (s == NULL) {
1572+
return 0;
1573+
}
15711574
if (size > INT_MAX) {
15721575
PyErr_SetString(PyExc_OverflowError, "string is too long");
15731576
return 0;

0 commit comments

Comments
 (0)