diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-29 05:03:55 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-29 05:03:55 +0000 |
commit | 67f77f29ed346c54a0316282ae3ec16d01dc7821 (patch) | |
tree | 3cde6b21b4ea57e555e37745f89dd7eb9f949600 /src | |
parent | 8a864d68bd6b1fd1bea16e7e45fa1e8765a2c7d2 (diff) |
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@6155 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index dedb6a2c3..eac70714d 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -1110,7 +1110,7 @@ SQLerror SQLConn::DoQuery(SQLrequest &req) * The +1 is for null-terminating the string for PQsendQuery() */ - 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 |