From 3758535dca82ede4b6f93c7a9d81e188aeaa19ce Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Thu, 8 Jan 2009 09:55:38 +0000 Subject: [PATCH] Merged revisions 68401 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r68401 | thomas.heller | 2009-01-08 10:34:20 +0100 (Do, 08 Jan 2009) | 2 lines Fixed a crash in ctypes, when HAVE_USABLE_WCHAR_T is false. Fixes issue #4867. ........ --- Misc/NEWS | 3 +++ Modules/_ctypes/callproc.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index e9dfcbaf3817..5167a6416cdf 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -70,6 +70,9 @@ Core and Builtins Library ------- +- Issue #4867: Fixed a crash in ctypes when passing a string to a + function without defining argtypes. + - Restore Python 2.3 compatibility for decimal.py. - Issue #3638: Remove functions from _tkinter module level that depend on diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 0f9f511ef76c..bf0de88f7978 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -645,8 +645,8 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa) #ifdef CTYPES_UNICODE if (PyUnicode_Check(obj)) { -#ifdef HAVE_USABLE_WCHAR_T pa->ffi_type = &ffi_type_pointer; +#ifdef HAVE_USABLE_WCHAR_T pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; -- 2.47.3