Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts_lua: change type in stats struct from 'int' to 'TSMgmtInt' to avoid overflow #8738

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugins/lua/ts_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
}
}
Expand Down