summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mysql.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mysql.c b/src/mysql.c
index 01cf0f6fe..cfc16a51d 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -250,7 +250,10 @@ char *db_mysql_secure(char *pass, int size)
{
char tmp_pass[PASSMAX];
char *str, *tmp;
- unsigned bufsize = (2 * PASSMAX + 15 + strlen(MysqlSecure));
+ unsigned bufsize = (2 * PASSMAX + 15);
+
+ if (MysqlSecure)
+ bufsize += strlen(MysqlSecure);
/* Initialize the buffer. Bug #86 */
memset(tmp_pass, 0, PASSMAX);