Skip to content

Commit

Permalink
Merge pull request #3876 from sysown/v2.x-3873
Browse files Browse the repository at this point in the history
Fix integer overflow and range for 'admin-stats_mysql_digest_to_disk' - Closes #3873
  • Loading branch information
renecannao authored May 13, 2022
2 parents f758241 + f05ebe3 commit 05a27c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ProxySQL_Admin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7773,7 +7773,7 @@ bool ProxySQL_Admin::set_variable(char *name, char *value) { // this is the pub
}
if (!strcasecmp(name,"stats_mysql_query_digest_to_disk")) {
int intv=atoi(value);
if (intv >= 0 && intv < 24*3600) {
if (intv >= 0 && intv <= 24*3600) {
variables.stats_mysql_query_digest_to_disk=intv;
GloProxyStats->variables.stats_mysql_query_digest_to_disk=intv;
return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/ProxySQL_Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ bool ProxySQL_Statistics::MySQL_Query_Cache_timetoget(unsigned long long curtime
}

bool ProxySQL_Statistics::mysql_query_digest_to_disk_timetoget(unsigned long long curtime) {
unsigned int i = (unsigned int)variables.stats_mysql_query_digest_to_disk;
unsigned long i = (unsigned long)variables.stats_mysql_query_digest_to_disk;
if (i) {
if (
( curtime > next_timer_mysql_query_digest_to_disk )
Expand Down

0 comments on commit 05a27c7

Please sign in to comment.