diff options
| author | Lars Kotthoff <lars@larsko.org> | 2025-02-05 19:52:51 -0700 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2025-02-07 12:13:16 -0400 |
| commit | 9c1f6cf746725af7bbbb66e746c5d694723ac0eb (patch) | |
| tree | f3c1b7b0fc87fa2970bddadb1f9efedf2102bee0 /bindings/python-cffi/notmuch2/_query.py | |
| parent | 409ad6b2a897c1571044bf6e4021a35fbd85b122 (diff) | |
fix segfaults in Python cFFI API and add tests
Several iterators in the Python cFFI API destroyed the objects they iterated
over too early (when the iterator was exhausted), causing subsequent segfaults
in common cases like creating a list from the iterator. This patch fixes the
segfaults and add tests to ensure that they don't happen again.
Diffstat (limited to 'bindings/python-cffi/notmuch2/_query.py')
| -rw-r--r-- | bindings/python-cffi/notmuch2/_query.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bindings/python-cffi/notmuch2/_query.py b/bindings/python-cffi/notmuch2/_query.py index 1db6ec96..169fcf27 100644 --- a/bindings/python-cffi/notmuch2/_query.py +++ b/bindings/python-cffi/notmuch2/_query.py @@ -52,7 +52,7 @@ class Query(base.NotmuchObject): This executes the query and returns an iterator over the :class:`Message` objects found. """ - msgs_pp = capi.ffi.new('notmuch_messages_t**') + msgs_pp = capi.ffi.new('notmuch_messages_t **') ret = capi.lib.notmuch_query_search_messages(self._query_p, msgs_pp) if ret != capi.lib.NOTMUCH_STATUS_SUCCESS: raise errors.NotmuchError(ret) |
