diff options
author | Noah Misch | 2015-02-07 04:14:27 +0000 |
---|---|---|
committer | Noah Misch | 2015-02-07 04:14:27 +0000 |
commit | a7a4adcf8d1e5a34a15ad86aee7d6aa0b8c15d43 (patch) | |
tree | 9750c2d056682ea00a4de85d9d3dc003db5af489 | |
parent | ff16b40f8cac67a740f4edaa9fc2d9c7ba44c73a (diff) |
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.
-rw-r--r-- | src/backend/libpq/pqcomm.c | 2 |
1 files changed, 2 insertions, 0 deletions
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 */ |