Fixed under-allocation (closes: #110)

This commit is contained in:
Federico Di Gregorio 2006-06-11 03:27:30 +00:00
parent fb0b523586
commit 9577f4e2a6
2 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2006-06-11 Federico Di Gregorio <fog@initd.org>
* Applied patch from wkv to avoid under-allocating query
space when the parameters are not of the right type
(Closes: #110).
* Applied patch from wkv to avoid off by one allocation of
connection encoding string (Closes: #109).

View File

@ -891,6 +891,7 @@ psyco_curs_callproc(cursorObject *self, PyObject *args, PyObject *kwargs)
if(parameters && parameters != Py_None) {
nparameters = PyObject_Length(parameters);
if (nparameters < 0) nparameters = 0;
}
/* allocate some memory, build the SQL and create a PyString from it */