From: Noah Misch Date: Sat, 7 Feb 2015 04:14:27 +0000 (-0500) Subject: Assert(PqCommReadingMsg) in pq_peekbyte(). X-Git-Tag: REL9_5_ALPHA1~798 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a7a4adcf8d1e5a34a15ad86aee7d6aa0b8c15d43;p=thirdparty%2Fpostgresql.git Assert(PqCommReadingMsg) in pq_peekbyte(). Interrupting pq_recvbuf() can break protocol sync, so its callers all deserve this assertion. The one pq_peekbyte() caller suffices already. --- diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 0d97aa45fbc..09dea4bbe16 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -928,6 +928,8 @@ pq_getbyte(void) int pq_peekbyte(void) { + Assert(PqCommReadingMsg); + while (PqRecvPointer >= PqRecvLength) { if (pq_recvbuf()) /* If nothing in buffer, then recv some */