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

Skip to content

Commit 25ff287

Browse files
committed
Issue #20515: Fix NULL pointer dereference introduced by issue #20368
CID 1167595
2 parents 3b55f0c + d33491e commit 25ff287

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
@@ -24,6 +24,8 @@ Core and Builtins
2424
Library
2525
-------
2626

27+
- Issue #20515: Fix NULL pointer dereference introduced by issue #20368.
28+
2729
- Issue #19186: Restore namespacing of expat symbols inside the pyexpat module.
2830

2931
- Issue #20053: ensurepip (and hence venv) are no longer affected by the

Modules/_tkinter.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,9 @@ varname_converter(PyObject *in, void *_out)
13971397
if (PyUnicode_Check(in)) {
13981398
Py_ssize_t size;
13991399
s = PyUnicode_AsUTF8AndSize(in, &size);
1400+
if (s == NULL) {
1401+
return 0;
1402+
}
14001403
if (size > INT_MAX) {
14011404
PyErr_SetString(PyExc_OverflowError, "string is too long");
14021405
return 0;

0 commit comments

Comments
 (0)