]> git.notmuchmail.org Git - notmuch/commitdiff
lib/n_d_index_file: check return value from _n_m_add_filename
authorDavid Bremner <david@tethera.net>
Sat, 20 Mar 2021 13:10:52 +0000 (10:10 -0300)
committerDavid Bremner <david@tethera.net>
Sun, 18 Apr 2021 13:02:20 +0000 (10:02 -0300)
Ignoring this return value seems like a bad idea in general, and in
particular it has been hiding one or more bugs related to handling
long directory names.

lib/add-message.cc

index 485debad225239211e9a6f165f24be519080a0ed..0c34d31822bb48a654631d3d41015c905e1fe07a 100644 (file)
@@ -529,7 +529,9 @@ notmuch_database_index_file (notmuch_database_t *notmuch,
            goto DONE;
        }
 
-       _notmuch_message_add_filename (message, filename);
+       ret = _notmuch_message_add_filename (message, filename);
+       if (ret)
+           goto DONE;
 
        if (is_new || is_ghost) {
            _notmuch_message_add_term (message, "type", "mail");