diff -r 87dfadd61e0d Modules/_ctypes/callproc.c --- a/Modules/_ctypes/callproc.c Thu Feb 04 01:24:56 2016 -0500 +++ b/Modules/_ctypes/callproc.c Fri Feb 05 00:39:56 2016 +0100 @@ -1606,6 +1606,7 @@ if ((size_t)size <= sizeof(obj->b_value)) { /* internal default buffer is large enough */ obj->b_size = size; + obj->b_length = size; goto done; } if (!_CDataObject_HasExternalBuffer(obj)) { @@ -1618,12 +1619,14 @@ memmove(ptr, obj->b_ptr, obj->b_size); obj->b_ptr = ptr; obj->b_size = size; + obj->b_length = size; } else { void * ptr = PyMem_Realloc(obj->b_ptr, size); if (ptr == NULL) return PyErr_NoMemory(); obj->b_ptr = ptr; obj->b_size = size; + obj->b_length = size; } done: Py_INCREF(Py_None);