aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/extra/m_mysql.cpp
diff options
context:
space:
mode:
authorGravatar peavey2006-12-29 01:46:13 +0000
committerGravatar peavey2006-12-29 01:46:13 +0000
commit6d79ddd5da846e6e89129abbfc9754ad0e2e0245 (patch)
tree58ab760a9ecb9b257a755226d9b181de07e7f1ae /src/modules/extra/m_mysql.cpp
parentForgot to init it, clean up mem leakage too and log X-Lines proper. (diff)
downloadinspircd++-6d79ddd5da846e6e89129abbfc9754ad0e2e0245.tar.gz
inspircd++-6d79ddd5da846e6e89129abbfc9754ad0e2e0245.tar.bz2
inspircd++-6d79ddd5da846e6e89129abbfc9754ad0e2e0245.zip
Writing beyond malloc'ed mem of a char pointer will crash with a vengeance. Fix it by actually doing the +1 mentioned in the comment above, but lacking from the actual code.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6152 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
-rw-r--r--src/modules/extra/m_mysql.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 2449b5238..19632d669 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -454,7 +454,7 @@ class SQLConnection : public classbase
* The +1 is for null-terminating the string for mysql_real_escape_string
*/
- query = new char[req.query.q.length() + (paramlen*2)];
+ query = new char[req.query.q.length() + (paramlen*2) + 1];
queryend = query;
/* Okay, now we have a buffer large enough we need to start copying the query into it and escaping and substituting