]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Oops, check for UBRK_DONE first
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Oct 2019 12:56:44 +0000 (13:56 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Oct 2019 12:56:44 +0000 (13:56 +0100)
src/libstat/tokenizers/tokenizers.c

index c533534edbc64fdda8ce0bee08dd794f93dbb75f..77a924f418c1b0afc7296a82e44cddd0732cf52a 100644 (file)
@@ -426,7 +426,7 @@ start_over:
                                                                        gint32 old_p = p;
                                                                        p = ubrk_next (bi);
 
-                                                                       if (p <= old_p) {
+                                                                       if (p != UBRK_DONE && p <= old_p) {
                                                                                msg_warn_pool_check (
                                                                                                "tokenization reversed back on position %d,"
                                                                                                "%d new position (%d backward), likely libicu bug!",
@@ -465,7 +465,7 @@ start_over:
                                                                while (last > p && p != UBRK_DONE) {
                                                                        gint32 old_p = p;
                                                                        p = ubrk_next (bi);
-                                                                       if (p <= old_p) {
+                                                                       if (p != UBRK_DONE && p <= old_p) {
                                                                                msg_warn_pool_check (
                                                                                                "tokenization reversed back on position %d,"
                                                                                                "%d new position (%d backward), likely libicu bug!",
@@ -567,7 +567,7 @@ start_over:
                        last = p;
                        p = ubrk_next (bi);
 
-                       if (p <= last) {
+                       if (p != UBRK_DONE && p <= last) {
                                msg_warn_pool_check ("tokenization reversed back on position %d,"
                                                 "%d new position (%d backward), likely libicu bug!",
                                                (gint)(p), (gint)(last), last - p);