diff options
author | Armin Rigo <arigo@tunes.org> | 2012-07-27 18:54:53 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2012-07-27 18:54:53 +0200 |
commit | e9bae85ecad79eb431944b172c5ce5f1e6127246 (patch) | |
tree | 82041783e3317914cf9f1c264f742fb1b7b9cd5e /cffi/backend_ctypes.py | |
parent | 9e0aeaee43838155930d65ecf53d5b3304f3c8de (diff) | |
download | cffi-e9bae85ecad79eb431944b172c5ce5f1e6127246.tar.gz |
Fix: the code incorrectly accepted e.g. 'ffi.new(ffi.new("int*"))',
by taking the type of the inner cdata object.
Diffstat (limited to 'cffi/backend_ctypes.py')
-rw-r--r-- | cffi/backend_ctypes.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py index e900247..ac5a02e 100644 --- a/cffi/backend_ctypes.py +++ b/cffi/backend_ctypes.py @@ -904,6 +904,8 @@ class CTypesBackend(object): return BType._offsetof(fieldname) def newp(self, BType, source): + if not issubclass(BType, CTypesData): + raise TypeError return BType._newp(source) def cast(self, BType, source): |