diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2019-09-04 12:27:16 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2019-09-04 12:30:18 +0100 |
commit | 80df0553a6450df25fa96ee4dbb6acf63efb8ffc (patch) | |
tree | f6eed1aea6492155cbc2a33e8c164b42f1780290 /psycopg/lobject_int.c | |
parent | 4d10f1235fed1c0aa5958cc4a9248688c3345aad (diff) | |
download | psycopg2-fix-961.tar.gz |
Fixed handling large Oid valuesfix-961
Oid is defined as unsigned 32. On some Python implementations (probably
the ones where maxint = 2 ** 31) this can cause int overflow for large
values (see #961). On my 64 box it doesn't seem the case.
Oid handling was sloppy here and there (messages, casts...): trying to
use uint everywhere, and added a couple of helper macros to treat Oid
consistently.
Close #961.
Diffstat (limited to 'psycopg/lobject_int.c')
-rw-r--r-- | psycopg/lobject_int.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/lobject_int.c b/psycopg/lobject_int.c index a14faef..973f163 100644 --- a/psycopg/lobject_int.c +++ b/psycopg/lobject_int.c @@ -176,7 +176,7 @@ lobject_open(lobjectObject *self, connectionObject *conn, self->oid = lo_creat(self->conn->pgconn, INV_READ | INV_WRITE); } - Dprintf("lobject_open: large object created with oid = %d", + Dprintf("lobject_open: large object created with oid = %u", self->oid); if (self->oid == InvalidOid) { |