]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 68401 via svnmerge from
authorThomas Heller <theller@ctypes.org>
Thu, 8 Jan 2009 09:55:38 +0000 (09:55 +0000)
committerThomas Heller <theller@ctypes.org>
Thu, 8 Jan 2009 09:55:38 +0000 (09:55 +0000)
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
Modules/_ctypes/callproc.c

index e9dfcbaf3817a8b9da7b761bf1e7ab1269088c73..5167a6416cdf8132de52675ae8f12c06063187ce 100644 (file)
--- 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
index 0f9f511ef76c185324b0c9b1cd47a9d3dd1d3e38..bf0de88f7978aaeff27214692bb3cbd140416e6d 100644 (file)
@@ -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;