]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix corner cases in non-ascii characters counter
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Feb 2017 14:34:12 +0000 (14:34 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Feb 2017 14:34:12 +0000 (14:34 +0000)
src/lua/lua_util.c

index 669ac5bd90bf3a715f02fe7a28f89ea8ea2c01b0..5bd59a32dcf6132d6693c01c610efadb77188eb5 100644 (file)
@@ -1904,6 +1904,10 @@ lua_util_count_non_ascii (lua_State *L)
                                ret ++;
                                total ++;
 
+                               if (np == NULL) {
+                                       break;
+                               }
+
                                p = (np != p) ? np : p + 1;
 
                                continue;