segfault in T590-libconfig notmuch_database_get_config_list: closed db

2020-10-27 Thread Olivier Taïbi
The test mentioned in the subject triggers a segfault. This is with xapian-core-1.4.16 on OpenBSD. Here is the backtrace: #0 0x05c9d491bec2 in Xapian::TermIterator::decref() () from /usr/local/lib/libxapian.so.5.1 #1 0x05c948827062 in Xapian::TermIterator::~TermIterator

[PATCH] test: sort the output of the "prefix" test in T610-message-property

2020-04-19 Thread Olivier Taïbi
This test extracts values from a (key,value) map where multiple entries can have the same key, and the entries are sorted by key, but not by value. The test incorrectly assumes that the values will be sorted as well, so sort the output. --- test/T610-message-property.sh | 12 1 file

[PATCH] test: sort the output of the "prefix" test in T610-message-property as needed

2020-04-17 Thread Olivier Taïbi
the "prefix" test in T610-message-property extracts values from a (key,value) map where multiple entries can have the same key, and the entries are sorted by key, but not by value. The test incorrectly assumes that the values will be sorted as well, so correct this by splitting the output using

Re: [PATCH] after gzgets(), Z_STREAM_END means EOF, not error

2020-04-14 Thread Olivier Taïbi
On Tue, Apr 14, 2020 at 05:38:32PM -0300, David Bremner wrote: > Olivier Taïbi writes: > > PS: out of curiosity, why bother with the --gzip feature in notmuch dump > > and restore when the user can simply pipe to/from a gzip/bzip2/xz/... > > command? > > I beli

[PATCH] after gzgets(), Z_STREAM_END means EOF, not error

2020-04-14 Thread Olivier Taïbi
As suggested by David Bremner in https://notmuchmail.org/pipermail/notmuch/2020/029288.html here is the patch for bug #3: after gzgets() returns NULL (meaning EOF or error), the error code Z_STREAM_END means EOF and not error. Context: I am compiling notmuch on OpenBSD which has a rather old zlib

[PATCH] gzerror() after gzclose_r() is a use after free

2020-04-14 Thread Olivier Taïbi
As suggested by David Bremner in https://notmuchmail.org/pipermail/notmuch/2020/029288.html here is a separate patch for bug #2: calling gzerror() (indirectly via gzerror_str()) after gzclose_r is a use after free, according to zlib's manual. diff --git a/notmuch-restore.c b/notmuch-restore.c

[PATCH] zlib-related bugs

2020-04-12 Thread Olivier Taïbi
the following diff addresses 3 zlib-related bugs in notmuch. 1) the second argument of gzerror() cannot be NULL, so replace it by a dummy 2) gzerror() cannot be closed after gzclosed(), so just print the error value instead. 3) in gz_getline(), if gz_error sets its second argument to