Skip to content

Commit

Permalink
Fix variable scope to prevent invalid memory access (netdata#18813)
Browse files Browse the repository at this point in the history
Wrong variable scope
  • Loading branch information
stelfrag authored Oct 18, 2024
1 parent 707a4c7 commit 8c42986
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/database/sqlite/sqlite_health.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,10 @@ void sql_alert_store_config(RRD_ALERT_PROTOTYPE *ap)
else
SQLITE_BIND_FAIL(done, sqlite3_bind_null(res, ++param));

char repeat[255];
if (!ap->config.has_custom_repeat_config)
SQLITE_BIND_FAIL(done, sqlite3_bind_null(res, ++param));
else {
char repeat[255];
snprintfz(repeat, sizeof(repeat) - 1, "warning %us critical %us", ap->config.warn_repeat_every, ap->config.crit_repeat_every);
SQLITE_BIND_FAIL(done, sqlite3_bind_text(res, ++param, repeat, -1, SQLITE_STATIC));
}
Expand Down

0 comments on commit 8c42986

Please sign in to comment.