diff options
author | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-07-07 21:02:38 +0000 |
---|---|---|
committer | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-07-07 21:02:38 +0000 |
commit | a30afed7b298b79235d5ec81e9bb0de8e6e3ebdc (patch) | |
tree | 240e67fdcd3689bd880860b3a89218f69904d5ea | |
parent | feedbd6b0db952ac689b9980097fd5d0e4d625cf (diff) |
Fix a crash when mysql is used without MysqlSecure defined. Thanks to
jerrcs for finding and testing
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2364 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/mysql.c | 5 |
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); |