forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdce92e5
committed
libpq: Correct processing of startup response messages
After sending a startup message, libpq expects either an errorresponse ('E') or an authentication request ('R'). Before processingthe message, it ensures it has read enough bytes to correspond to thelength specified in the message. However, when processing the 'R'message, if an EOF status is returned it loops back waiting for moreinput, even though we already checked that we have enough input. Inthis particular case, this is probably not reachable anyway, becauseother code ensures we have enough bytes for an authentication requestmessage, but the code is wrong and misleading. In the more generalcase, processing a faulty message could result in an EOF status, whichwould then result in an infinite loop waiting for the end of a messagethat will never come. The correction is to make this an error.Reported-by: Jacob Champion <jchampion@timescale.com>Discussion:https://www.postgresql.org/message-id/flat/f9c7862f-b864-8ef7-a861-c4638c83e209@enterprisedb.com1 parent3d0c95b commitdce92e5
1 file changed
+1
-2
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3358 | 3358 |
| |
3359 | 3359 |
| |
3360 | 3360 |
| |
3361 |
| - | |
3362 |
| - | |
| 3361 | + | |
3363 | 3362 |
| |
3364 | 3363 |
| |
3365 | 3364 |
| |
|
0 commit comments
Comments
(0)