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

Skip to content

Commit 5e4e427

Browse files
author
Thomas Heller
committed
Fixed a crash in ctypes, when HAVE_USABLE_WCHAR_T is false.
Fixes issue #4867.
1 parent 2f94736 commit 5e4e427

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ Core and Builtins
8888
Library
8989
-------
9090

91+
- Issue #4867: Fixed a crash in ctypes when passing a string to a
92+
function without defining argtypes.
93+
9194
- Issue #4272: Add an optional argument to the GzipFile constructor to override
9295
the timestamp in the gzip stream. The default value remains the current time.
9396
The information can be used by e.g. gunzip when decompressing. Patch by

Modules/_ctypes/callproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
645645

646646
#ifdef CTYPES_UNICODE
647647
if (PyUnicode_Check(obj)) {
648-
#ifdef HAVE_USABLE_WCHAR_T
649648
pa->ffi_type = &ffi_type_pointer;
649+
#ifdef HAVE_USABLE_WCHAR_T
650650
pa->value.p = PyUnicode_AS_UNICODE(obj);
651651
Py_INCREF(obj);
652652
pa->keep = obj;

0 commit comments

Comments
 (0)