]> granicus.if.org Git - postgresql/commit
Improve handling of out-of-memory in libpq.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Jul 2015 15:37:45 +0000 (18:37 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Jul 2015 15:45:17 +0000 (18:45 +0300)
commit992c6f0d2ca839ba54279fbc1a5d5e01e2e18f58
tree91b44b8ac25ffa01a6f71cff7310ff1d1f0867e6
parent4dac5651b15ded7ce3b730aec936bec957b2c86a
Improve handling of out-of-memory in libpq.

If an allocation fails in the main message handling loop, pqParseInput3
or pqParseInput2, it should not be treated as "not enough data available
yet". Otherwise libpq will wait indefinitely for more data to arrive from
the server, and gets stuck forever.

This isn't a complete fix - getParamDescriptions and getCopyStart still
have the same issue, but it's a step in the right direction.

Michael Paquier and me. Backpatch to all supported versions.
src/interfaces/libpq/fe-protocol2.c
src/interfaces/libpq/fe-protocol3.c