]> granicus.if.org Git - python/commit
ctypes: fix CThunkObject_new()
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 27 Jul 2016 14:58:47 +0000 (16:58 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 27 Jul 2016 14:58:47 +0000 (16:58 +0200)
commit2e1a34025cde19bddf12a2eac8fedb6afcca8339
treee169d66ec6007df9c532b7ac4aca602b16b92380
parent2a0438d2e4f023b5edf0fcb27151b6ec4357642e
ctypes: fix CThunkObject_new()

* Initialize restype and flags fields to fix a crash when Python runs on a
  read-only file system
* Use Py_ssize_t type rather than int for the "i" iterator variable
* Reorder assignements to be able to more easily check if all fields are
  initialized

Issue #11048. Initial patch written by Marcin Bachry.
Modules/_ctypes/callbacks.c