U_set() from ctypes.
CID #486657
Library
-------
+- Issue #18556: Check the return value of a PyUnicode_AsWideChar() call in
+ ctypes' U_set().
+
- Issue #18549: Eliminate dead code in socket_ntohl()
- Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
} else if (size < length-1)
/* copy terminating NUL character if there is space */
size += 1;
- PyUnicode_AsWideChar(value, (wchar_t *)ptr, size);
+
+ if (PyUnicode_AsWideChar(value, (wchar_t *)ptr, size) == -1) {
+ return NULL;
+ }
+
return value;
}