Fixed memory overflow.

This commit is contained in:
Federico Di Gregorio 2006-02-11 06:57:34 +00:00
parent 95365f0f3e
commit 94d663c6b6
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,9 @@
2006-02-11 Federico Di Gregorio <fog@initd.org>
* setup.py: Applied patch from lbruno.
* psycopg/psycopgmodule.c: applied fix for memory overflow in
connect() (reported by solt, #91.)
* setup.py: applied patch from lbruno.
2006-01-11 Federico Di Gregorio <fog@initd.org>

View File

@ -144,7 +144,7 @@ psyco_connect(PyObject *self, PyObject *args, PyObject *keywds)
PyOS_snprintf(port, 16, "%d", iport);
if (dsn == NULL) {
int l = 36; /* len("dbname= user= password= host= port=\0") */
int l = 45; /* len("dbname= user= password= host= port= sslmode=\0") */
if (database) l += strlen(database);
if (host) l += strlen(host);