diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-10-08 21:12:27 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-10-08 21:19:53 -0400 |
commit | 0e924c007dbb74f8f7dbdb75810c9b9a8ed6d3ec (patch) | |
tree | c24505052700de320398f03941e9cea00699cc0a /src/backend/access/transam | |
parent | b6d45222969a82aff0e9f115842c87136d429479 (diff) | |
download | postgresql-0e924c007dbb74f8f7dbdb75810c9b9a8ed6d3ec.tar.gz postgresql-0e924c007dbb74f8f7dbdb75810c9b9a8ed6d3ec.zip |
Fix lo_read, lo_write, lo_truncate to cope with "size_t" length parameters.
libpq defines these functions as accepting "size_t" lengths ... but the
underlying backend functions expect signed int32 length parameters, and so
will misinterpret any value exceeding INT_MAX. Fix the libpq side to throw
error rather than possibly doing something unexpected.
This is a bug of long standing, but I doubt it's worth back-patching. The
problem is really pretty academic anyway with lo_read/lo_write, since any
caller expecting sane behavior would have to have provided a multi-gigabyte
buffer. It's slightly more pressing with lo_truncate, but still we haven't
supported large objects over 2GB until now.
Diffstat (limited to 'src/backend/access/transam')
0 files changed, 0 insertions, 0 deletions