Don't ignore silently the cursor.callproc argument without a length

This commit is contained in:
Daniele Varrazzo 2014-06-05 02:46:06 +02:00
parent e076e935b9
commit 115ceea1eb
2 changed files with 7 additions and 2 deletions

6
NEWS
View File

@ -10,6 +10,12 @@ Bug fixes:
(:ticket:`#191`).
What's new in psycopg 2.5.4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Don't ignore silently the `cursor.callproc` argument without a length.
What's new in psycopg 2.5.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

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