Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package notmuch for openSUSE:Factory checked in at 2021-11-04 16:10:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/notmuch (Old) and /work/SRC/openSUSE:Factory/.notmuch.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "notmuch" Thu Nov 4 16:10:00 2021 rev:39 rq:929139 version:0.34.1 Changes: -------- --- /work/SRC/openSUSE:Factory/notmuch/notmuch.changes 2021-10-25 15:18:46.857726185 +0200 +++ /work/SRC/openSUSE:Factory/.notmuch.new.1890/notmuch.changes 2021-11-04 16:10:42.253086593 +0100 @@ -1,0 +2,17 @@ +Wed Nov 3 15:50:43 UTC 2021 - Dan ??erm??k <dcer...@suse.com> + +- New upstream release 0.34.1 + +What's new in notmuch 0.34.1 +========================= + +Library +------- + +Fix for deallocation and nulling of output parameter for +notmuch_database_{open_with,create_with,load}_config when errors +occur. This change fixes a potential use-after-free bug that has been +present since 0.32. This release also improves the documentation of +status returns for the same 3 functions. + +------------------------------------------------------------------- Old: ---- notmuch-0.34.tar.xz notmuch-0.34.tar.xz.asc New: ---- notmuch-0.34.1.tar.xz notmuch-0.34.1.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ notmuch.spec ++++++ --- /var/tmp/diff_new_pack.zivhcN/_old 2021-11-04 16:10:42.785086904 +0100 +++ /var/tmp/diff_new_pack.zivhcN/_new 2021-11-04 16:10:42.785086904 +0100 @@ -18,7 +18,7 @@ %define libversion 5 Name: notmuch -Version: 0.34 +Version: 0.34.1 Release: 0 Summary: The mail indexer License: GPL-3.0-or-later ++++++ notmuch-0.34.tar.xz -> notmuch-0.34.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/NEWS new/notmuch-0.34.1/NEWS --- old/notmuch-0.34/NEWS 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/NEWS 2021-11-03 14:20:49.000000000 +0100 @@ -1,3 +1,15 @@ +Notmuch 0.34.1 (2021-11-03) +=========================== + +Library +------- + +Fix for deallocation and nulling of output parameter for +notmuch_database_{open_with,create_with,load}_config when errors +occur. This change fixes a potential use-after-free bug that has been +present since 0.32. This release also improves the documentation of +status returns for the same 3 functions. + Notmuch 0.34 (2021-10-20) ========================= @@ -7,7 +19,7 @@ An optional new s-expression based query parser is available if notmuch is built with the `sfsexp` library. See notmuch-sexp-queries(7) for syntax, and use `notmuch config get -built_with.sexpr_queries` to check if notmuch is compiled with +built_with.sexpr_query` to check if notmuch is compiled with s-expression query support. CLI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/bindings/python/notmuch/version.py new/notmuch-0.34.1/bindings/python/notmuch/version.py --- old/notmuch-0.34/bindings/python/notmuch/version.py 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/bindings/python/notmuch/version.py 2021-11-03 14:20:49.000000000 +0100 @@ -1,3 +1,3 @@ # this file should be kept in sync with ../../../version -__VERSION__ = '0.34' +__VERSION__ = '0.34.1' SOVERSION = '5' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/bindings/python-cffi/version.txt new/notmuch-0.34.1/bindings/python-cffi/version.txt --- old/notmuch-0.34/bindings/python-cffi/version.txt 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/bindings/python-cffi/version.txt 2021-11-03 14:20:49.000000000 +0100 @@ -1 +1 @@ -0.34 +0.34.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/debian/changelog new/notmuch-0.34.1/debian/changelog --- old/notmuch-0.34/debian/changelog 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/debian/changelog 2021-11-03 14:20:49.000000000 +0100 @@ -1,3 +1,10 @@ +notmuch (0.34.1-1) unstable; urgency=medium + + * New upstream bugfix release. Fixes a memory deallocation error in + libnotmuch. + + -- David Bremner <brem...@debian.org> Wed, 03 Nov 2021 10:20:33 -0300 + notmuch (0.34-1) unstable; urgency=medium * New upstream release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/lib/notmuch.h new/notmuch-0.34.1/lib/notmuch.h --- old/notmuch-0.34/lib/notmuch.h 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/lib/notmuch.h 2021-11-03 14:20:49.000000000 +0100 @@ -433,6 +433,8 @@ * @retval NOTMUCH_STATUS_NULL_POINTER: The given \a database * argument is NULL. * + * @retval NOTMUCH_STATUS_NO_CONFIG: No config file was found. Fatal. + * * @retval NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory. * * @retval NOTMUCH_STATUS_FILE_ERROR: An error occurred trying to open the @@ -458,6 +460,9 @@ * * For description of arguments, @see notmuch_database_open_with_config * + * For errors other then NO_DATABASE and NO_CONFIG, *database is set to + * NULL. + * * @retval NOTMUCH_STATUS_SUCCESS: Successfully loaded configuration. * * @retval NOTMUCH_STATUS_NO_CONFIG: No config file was loaded. Not fatal. @@ -489,6 +494,9 @@ * * For description of arguments, @see notmuch_database_open_with_config * + * In case of any failure, this function returns an error status and + * sets *database to NULL. + * * @retval NOTMUCH_STATUS_SUCCESS: Successfully created the database. * * @retval NOTMUCH_STATUS_DATABASE_EXISTS: Database already exists, not created diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/lib/open.cc new/notmuch-0.34.1/lib/open.cc --- old/notmuch-0.34/lib/open.cc 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/lib/open.cc 2021-11-03 14:20:49.000000000 +0100 @@ -396,8 +396,6 @@ " has a newer database format version (%u) than supported by this\n" " version of notmuch (%u).\n", database_path, version, NOTMUCH_DATABASE_VERSION)); - notmuch_database_destroy (notmuch); - notmuch = NULL; status = NOTMUCH_STATUS_FILE_ERROR; goto DONE; } @@ -414,8 +412,6 @@ " requires features (%s)\n" " not supported by this version of notmuch.\n", database_path, incompat_features)); - notmuch_database_destroy (notmuch); - notmuch = NULL; status = NOTMUCH_STATUS_FILE_ERROR; goto DONE; } @@ -489,8 +485,6 @@ } catch (const Xapian::Error &error) { IGNORE_RESULT (asprintf (&message, "A Xapian exception occurred opening database: %s\n", error.get_msg ().c_str ())); - notmuch_database_destroy (notmuch); - notmuch = NULL; status = NOTMUCH_STATUS_XAPIAN_EXCEPTION; } DONE: @@ -559,10 +553,13 @@ free (message); } + if (status && notmuch) { + notmuch_database_destroy (notmuch); + notmuch = NULL; + } + if (database) *database = notmuch; - else - talloc_free (notmuch); if (notmuch) notmuch->open = true; @@ -717,10 +714,16 @@ else free (message); } + if (status && notmuch) { + notmuch_database_destroy (notmuch); + notmuch = NULL; + } + if (database) *database = notmuch; - else - talloc_free (notmuch); + + if (notmuch) + notmuch->open = true; return status; } @@ -868,6 +871,13 @@ if (status_string) *status_string = message; + if (status && + status != NOTMUCH_STATUS_NO_DATABASE + && status != NOTMUCH_STATUS_NO_CONFIG) { + notmuch_database_destroy (notmuch); + notmuch = NULL; + } + if (database) *database = notmuch; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/test/T590-libconfig.sh new/notmuch-0.34.1/test/T590-libconfig.sh --- old/notmuch-0.34/test/T590-libconfig.sh 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/test/T590-libconfig.sh 2021-11-03 14:20:49.000000000 +0100 @@ -461,7 +461,7 @@ } EOF rm -f ${ovconfig} -NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +export NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} cat <<'EOF' >EXPECTED == stdout == test.key1 = overridden-home @@ -488,7 +488,7 @@ } EOF rm -f ${ovconfig} -NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +export NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} cat <<'EOF' >EXPECTED == stdout == test.key1 = overridden-xdg @@ -515,7 +515,7 @@ } EOF rm -f ${ovconfig} -NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +export NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} cat <<'EOF' >EXPECTED == stdout == test.key1 = overridden-xdg-profile @@ -541,7 +541,7 @@ } EOF #rm -f ${ovconfig} -NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +export NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} cat <<'EOF' >EXPECTED == stdout == test.key1 = overridden-profile @@ -559,7 +559,7 @@ printf("NOT RUN"); } EOF -NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +export NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} cat <<'EOF' >EXPECTED == stdout == == stderr == @@ -604,7 +604,7 @@ printf("test.key2 = %s\n", val); } EOF -NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +export NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} unset NOTMUCH_DATABASE cat <<'EOF' >EXPECTED == stdout == @@ -783,7 +783,7 @@ } EOF rm -f ${ovconfig} -NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +export NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} cat <<'EOF' >EXPECTED == stdout == test.key1 = overridden-home @@ -848,5 +848,108 @@ == stderr == EOF test_expect_equal_file EXPECTED OUTPUT + +cat <<EOF > c_head3 +#include <notmuch-test.h> +int main (int argc, char **argv) { + notmuch_status_t stat; + notmuch_database_t *db = NULL; +EOF + +cat <<EOF > c_tail3 + printf("db == NULL: %d\n", db == NULL); +} +EOF + +test_begin_subtest "open: database set to null on missing config" +cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} + notmuch_status_t st = notmuch_database_open_with_config(argv[1], + NOTMUCH_DATABASE_MODE_READ_ONLY, + "/nonexistent", NULL, &db, NULL); +EOF +cat <<EOF> EXPECTED +== stdout == +db == NULL: 1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "open: database set to null on missing config (env)" +old_NOTMUCH_CONFIG=${NOTMUCH_CONFIG} +NOTMUCH_CONFIG="/nonexistent" +cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} + notmuch_status_t st = notmuch_database_open_with_config(argv[1], + NOTMUCH_DATABASE_MODE_READ_ONLY, + NULL, NULL, &db, NULL); +EOF +NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +cat <<EOF> EXPECTED +== stdout == +db == NULL: 1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "create: database set to null on missing config" +cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} "/nonexistent" + notmuch_status_t st = notmuch_database_create_with_config(argv[1],argv[2], NULL, &db, NULL); +EOF +cat <<EOF> EXPECTED +== stdout == +db == NULL: 1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "create: database set to null on missing config (env)" +old_NOTMUCH_CONFIG=${NOTMUCH_CONFIG} +NOTMUCH_CONFIG="/nonexistent" +cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} + notmuch_status_t st = notmuch_database_create_with_config(argv[1], + NULL, NULL, &db, NULL); +EOF +NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +cat <<EOF> EXPECTED +== stdout == +db == NULL: 1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "load_config: database set non-null on missing config" +cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} "/nonexistent" + notmuch_status_t st = notmuch_database_load_config(argv[1],argv[2], NULL, &db, NULL); +EOF +cat <<EOF> EXPECTED +== stdout == +db == NULL: 0 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "load_config: database non-null on missing config (env)" +old_NOTMUCH_CONFIG=${NOTMUCH_CONFIG} +NOTMUCH_CONFIG="/nonexistent" +cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} + notmuch_status_t st = notmuch_database_load_config(argv[1], NULL, NULL, &db, NULL); +EOF +NOTMUCH_CONFIG=${old_NOTMUCH_CONFIG} +cat <<EOF> EXPECTED +== stdout == +db == NULL: 0 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "load_config: database set to NULL on fatal error" +cat c_head3 - c_tail3 <<'EOF' | test_C + notmuch_status_t st = notmuch_database_load_config("relative", NULL, NULL, &db, NULL); +EOF +cat <<EOF> EXPECTED +== stdout == +db == NULL: 1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notmuch-0.34/version.txt new/notmuch-0.34.1/version.txt --- old/notmuch-0.34/version.txt 2021-10-20 16:25:35.000000000 +0200 +++ new/notmuch-0.34.1/version.txt 2021-11-03 14:20:49.000000000 +0100 @@ -1 +1 @@ -0.34 +0.34.1