From 2e3b7673a25168a1649f780ec898c9e713c7936f Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Thu, 17 Mar 2022 14:46:47 +0000 Subject: [PATCH] ts_lua: change type in stats struct from 'int' to 'TSMgmtInt' to avoid overflow --- plugins/lua/ts_lua.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/lua/ts_lua.c b/plugins/lua/ts_lua.c index b52355a1776..ea9f8aed9ee 100644 --- a/plugins/lua/ts_lua.c +++ b/plugins/lua/ts_lua.c @@ -73,8 +73,8 @@ static char const *const ts_lua_g_stat_strs[] = { typedef struct { ts_lua_main_ctx *main_ctx_array; - int gc_kb; // last collected gc in kb - int threads; // last collected number active threads + TSMgmtInt gc_kb; // last collected gc in kb + TSMgmtInt threads; // last collected number active threads int stat_inds[TS_LUA_IND_SIZE]; // stats indices @@ -184,8 +184,8 @@ collectStats(ts_lua_plugin_stats *const plugin_stats) ts_lua_ctx_stats *const stats = main_ctx->stats; TSMutexLock(stats->mutexp); - gc_kb_total += (TSMgmtInt)stats->gc_kb; - threads_total += (TSMgmtInt)stats->threads; + gc_kb_total += stats->gc_kb; + threads_total += stats->threads; TSMutexUnlock(stats->mutexp); } }