]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix out of bound access in lua logger
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 20 Jun 2019 11:37:40 +0000 (12:37 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Jun 2019 11:34:59 +0000 (12:34 +0100)
src/lua/lua_logger.c

index 60c702e65218ea3df2ae856e36f4e61c0f39e86a..bca4bc6e3237ac7538cab52ddb27398038708e04 100644 (file)
@@ -326,7 +326,7 @@ lua_logger_out_str (lua_State *L, gint pos,
                        s = 0;
 
                        while (slen > 0 && len > 1) {
-                               if (!lua_logger_char_safe (str[r], esc_type)) {
+                               if (!lua_logger_char_safe (str[s], esc_type)) {
                                        if (len >= 3) {
                                                outbuf[r++] = '\\';
                                                outbuf[r++] = hexdigests[((str[s] >> 4) & 0xF)];