From 115ceea1eb894b23dfbfe92cf7479ddf47f6de1b Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 5 Jun 2014 02:46:06 +0200 Subject: [PATCH] Don't ignore silently the `cursor.callproc` argument without a length --- NEWS | 6 ++++++ psycopg/cursor_type.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 9216010e..51830ff1 100644 --- a/NEWS +++ b/NEWS @@ -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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 623ed128..ddbed298 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -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 */