aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-13 14:34:12 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-13 14:34:12 +0000
commit3103d0192c6982ffca3bf8672c82b3e5318aa5d9 (patch)
treef02d8a8a76c41439d5f91d3d4729d47a634b05ce /src/lua/lua_util.c
parenta8220235826d158f216ee0dfce2fb3b6a0939a75 (diff)
downloadrspamd-3103d0192c6982ffca3bf8672c82b3e5318aa5d9.tar.gz
rspamd-3103d0192c6982ffca3bf8672c82b3e5318aa5d9.zip
[Minor] Fix corner cases in non-ascii characters counter
Diffstat (limited to 'src/lua/lua_util.c')
-rw-r--r--src/lua/lua_util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index 669ac5bd9..5bd59a32d 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -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;