diff options
author | Thomas Heller <theller@ctypes.org> | 2009-02-10 18:43:01 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2009-02-10 18:43:01 (GMT) |
commit | 3689ae256e4b121eec1540ec9cf61d73a131a0e5 (patch) | |
tree | 7bb03b88855f55f583bf920dadc671b96664acdb /Modules | |
parent | d155bbfbb28944c2825a2327baed386a38456db2 (diff) | |
download | cpython-3689ae256e4b121eec1540ec9cf61d73a131a0e5.zip cpython-3689ae256e4b121eec1540ec9cf61d73a131a0e5.tar.gz cpython-3689ae256e4b121eec1540ec9cf61d73a131a0e5.tar.bz2 |
Issue#5203: ctypes segfaults when passing a unicode string to a
function without argtypes, if HAVE_USABLE_WCHAR_T is false.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/callproc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 7f7d641..8988c12 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -664,6 +664,7 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa) return 0; #else int size = PyUnicode_GET_SIZE(obj); + pa->ffi_type = &ffi_type_pointer; size += 1; /* terminating NUL */ size *= sizeof(wchar_t); pa->value.p = PyMem_Malloc(size); |