Skip to content

Commit

Permalink
Initialize slaveresult to 0 and use strncat instead of bsd strlcat
Browse files Browse the repository at this point in the history
  • Loading branch information
RincewindsHat committed Sep 18, 2023
1 parent c405dba commit ce355c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/check_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ main (int argc, char **argv)

char *result = NULL;
char *error = NULL;
char slaveresult[SLAVERESULTSIZE];
char slaveresult[SLAVERESULTSIZE] = { 0 };
char* perf;

perf = strdup ("");
Expand Down Expand Up @@ -299,7 +299,7 @@ main (int argc, char **argv)
if (mysqldump_threads == 0) {
die (STATE_CRITICAL, "%s\n", slaveresult);
} else {
strlcat (slaveresult, " Mysqldump: in progress", SLAVERESULTSIZE);
strncat(slaveresult, " Mysqldump: in progress", SLAVERESULTSIZE-1);
}
}

Expand Down

0 comments on commit ce355c8

Please sign in to comment.