From 67f77f29ed346c54a0316282ae3ec16d01dc7821 Mon Sep 17 00:00:00 2001 From: peavey Date: Fri, 29 Dec 2006 05:03:55 +0000 Subject: 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 --- src/modules/extra/m_pgsql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/extra') 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 -- cgit v1.2.3