summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2006-09-23 05:14:24 +0000
committerFederico Di Gregorio <fog@initd.org>2006-09-23 05:14:24 +0000
commit474d8b9d512b859e9c93539757e217859181bb77 (patch)
tree802fd5ca0e15a016f559ae44d11b83b41f52f5f1
parent3009a29b1191a25cf1194e07e31ba52d2eb1ea7b (diff)
downloadpsycopg2-474d8b9d512b859e9c93539757e217859181bb77.tar.gz
Piet Delport patches: 2 of 3.
-rw-r--r--ChangeLog6
-rw-r--r--psycopg/adapter_binary.c2
-rw-r--r--psycopg/adapter_qstring.c2
-rw-r--r--psycopg/cursor_type.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9e5b2db..2aaf0bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
2006-09-23 Federico Di Gregorio <fog@initd.org>
+
+ * 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 0fc8101..030447b 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 2eaf7f3..86da105 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 73e4de6..6d58e87 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;