postgresql/src/interfaces/libpq
Tom Lane e3bf3c0f8c Fix misuse of an integer as a bool.
pgtls_read_pending is declared to return bool, but what the underlying
SSL_pending function returns is a count of available bytes.

This is actually somewhat harmless if we're using C99 bools, but in
the back branches it's a live bug: if the available-bytes count happened
to be a multiple of 256, it would get converted to a zero char value.
On machines where char is signed, counts of 128 and up could misbehave
as well.  The net effect is that when using SSL, libpq might block
waiting for data even though some has already been received.

Broken by careless refactoring in commit 4e86f1b16, so back-patch
to 9.5 where that came in.

Per bug #15802 from David Binderman.

Discussion: https://postgr.es/m/15802-f0911a97f0346526@postgresql.org
2019-05-13 10:53:19 -04:00
..
po Translation updates 2019-05-06 14:43:35 +02:00
test Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:31 -04:00
.gitignore Add missing erand48.c to libpq/.gitignore. 2017-04-20 16:31:28 -04:00
exports.txt Add PQencryptPasswordConn function to libpq, use it in psql and createuser. 2017-05-03 11:19:07 +03:00
fe-auth-scram.c Minor cleanup/future-proofing for pg_saslprep(). 2018-09-08 18:20:36 -04:00
fe-auth.c Change libpq's internal uses of PQhost() to inspect host field directly. 2018-08-03 12:12:10 -04:00
fe-auth.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
fe-connect.c In libpq, don't look up all the hostnames at once. 2018-08-23 16:39:20 -04:00
fe-exec.c Client-side fixes for delayed NOTIFY receipt. 2018-10-19 22:22:57 -04:00
fe-lobj.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
fe-misc.c Fix misuse of an integer as a bool. 2019-05-13 10:53:19 -04:00
fe-print.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
fe-protocol2.c In libpq, free any partial query result before collecting a server error. 2018-04-13 12:53:45 -04:00
fe-protocol3.c In libpq, free any partial query result before collecting a server error. 2018-04-13 12:53:45 -04:00
fe-secure-openssl.c Fix misuse of an integer as a bool. 2019-05-13 10:53:19 -04:00
fe-secure.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
libpq-events.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
libpq-events.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
libpq-fe.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
libpq-int.h In libpq, don't look up all the hostnames at once. 2018-08-23 16:39:20 -04:00
libpq.rc.in Stamp 10.8. 2019-05-06 16:48:45 -04:00
Makefile Add newly-symlinked files to "make clean" target. 2017-04-08 14:25:45 -04:00
nls.mk Translation updates 2018-02-05 12:27:10 -05:00
pg_service.conf.sample Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pqexpbuffer.c Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pqexpbuffer.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pthread-win32.c Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
README Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
win32.h Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00

src/interfaces/libpq/README

This directory contains the C version of Libpq, the POSTGRES frontend library.