forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb9b6105
committed
Fix ancient violation of zlib's API spec.
contrib/pgcrypto mishandled the case where deflate() does not consumeall of the offered input on the first try. It reset the next_in pointerto the start of the input instead of leaving it alone, causing the wrongdata to be fed to the next deflate() call.This has been broken since pgcrypto was committed. The reason for thelack of complaints seems to be that it's fairly hard to get stock zlibto not consume all the input, so long as the output buffer is big enough(which it normally would be in pgcrypto's usage; AFAICT the input isalways going to be packetized into packets no larger than ZIP_OUT_BUF).However, IBM's zlibNX implementation for AIX evidently will do itin some cases.I did not add a test case for this, because I couldn't find one thatwould fail with stock zlib. When we put back the test case forbug #16476, that will cover the zlibNX situation well enough.While here, write deflate()'s second argument as Z_NO_FLUSH per itsAPI spec, instead of hard-wiring the value zero.Per buildfarm results and subsequent investigation.Discussion:https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.org1 parent5733fa0 commitb9b6105
1 file changed
+5
-5
lines changedLines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
117 |
| - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 |
| |
119 |
| - | |
120 |
| - | |
121 | 121 |
| |
122 | 122 |
| |
123 |
| - | |
| 123 | + | |
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
| |||
131 | 131 |
| |
132 | 132 |
| |
133 | 133 |
| |
134 |
| - | |
135 | 134 |
| |
136 | 135 |
| |
137 | 136 |
| |
| |||
154 | 153 |
| |
155 | 154 |
| |
156 | 155 |
| |
| 156 | + | |
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
|
0 commit comments
Comments
(0)