forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita3ab7a7
committed
Fix corner case with 16kB-long decompression in pgcrypto, take 2
A compressed stream may end with an empty packet. In this casedecompression finishes before reading the empty packet and theremaining stream packet causes a failure in reading the followingdata. This commit makes sure to consume such extra data, avoiding afailure when decompression the data. This corner case was reproducibleeasily with a data length of 16kB, and existed sincee94dd6a. A cheapregression test is added to cover this case based on a random,incompressible string.The first attempt of this patch has allowed to find an older failurewithin the compression logic of pgcrypto, fixed byb9b6105. Thisinvolved SLES 15 with z390 where a custom flavor of libz gets used.Bonus thanks to Mark Wong for providing access to the specificenvironment.Reported-by: Frank GagnepainAuthor: Kyotaro Horiguchi, Michael PaquierReviewed-by: Tom LaneDiscussion:https://postgr.es/m/16476-692ef7b84e5fb893@postgresql.orgBackpatch-through: 9.51 parente971357 commita3ab7a7
File tree
3 files changed
+72
-0
lines changed- contrib/pgcrypto
- expected
- sql
3 files changed
+72
-0
lines changedLines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + |
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
286 | 286 |
| |
287 | 287 |
| |
288 | 288 |
| |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
289 | 309 |
| |
| 310 | + | |
290 | 311 |
| |
291 | 312 |
| |
292 | 313 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + |
0 commit comments
Comments
(0)