]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts-flatcurve: fts_backend_flatcurve_update_build_more() - Truncate in utf8-safe...
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 21 Jan 2025 11:11:00 +0000 (11:11 +0000)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:16 +0000 (12:34 +0200)
src/plugins/fts-flatcurve/fts-backend-flatcurve.c

index c1807bdc9856107ace1c49fc25f15a41fe3ace86..bd6a8b27f31ee084ca50317e6540aac89ea060cf 100644 (file)
@@ -324,7 +324,9 @@ fts_backend_flatcurve_update_build_more(struct fts_backend_update_context *_ctx,
         * are realistically going to search with more than 10s of
         * characters. Therefore, limit term size (via a configurable
         * value). */
+       size_t orig_size = size;
        size = I_MIN(size, ctx->backend->fuser->set->max_term_size);
+       size = uni_utf8_data_truncate(data, orig_size, size);
 
        const char *error;
        int ret;