diff --git a/ChangeLog b/ChangeLog index 9e5b2db9..2aaf0bc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ 2006-09-23 Federico Di Gregorio + + * Applied patch 2/3 from Piet Delport; from his email: + psycopg2-Py_ssize_t-output.diff adjusts variables used as outputs + from CPython API calls: without it the calls try to write 64 bits + to 32 bit locations, trampling over adjacent values/pointers, + and segfaulting later. * Applied patch 1/3 from Piet Delport; from his email: psycopg2-PyObject_HEAD.diff adds missing underscores to several diff --git a/psycopg/adapter_binary.c b/psycopg/adapter_binary.c index 0fc8101e..030447b2 100644 --- a/psycopg/adapter_binary.c +++ b/psycopg/adapter_binary.c @@ -134,7 +134,7 @@ binary_quote(binaryObject *self) { char *to; const char *buffer; - int buffer_len; + Py_ssize_t buffer_len; size_t len = 0; /* if we got a plain string or a buffer we escape it and save the buffer */ diff --git a/psycopg/adapter_qstring.c b/psycopg/adapter_qstring.c index 2eaf7f34..86da1052 100644 --- a/psycopg/adapter_qstring.c +++ b/psycopg/adapter_qstring.c @@ -92,7 +92,7 @@ qstring_quote(qstringObject *self) { PyObject *str; char *s, *buffer; - int len; + Py_ssize_t len; /* if the wrapped object is an unicode object we can encode it to match self->encoding but if the encoding is not specified we don't know what diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 73e4de66..6d58e872 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -1090,7 +1090,7 @@ psyco_curs_copy_from(cursorObject *self, PyObject *args, PyObject *kwargs) PyObject* collistiter = PyObject_GetIter(columns); PyObject* col; int collistlen = 2; - int colitemlen; + Py_ssize_t colitemlen; char* colname; if (collistiter == NULL) { return NULL;