Commit afcd276
zlib: Fix handling of gzip magic bytes mid-file
Only treat the gzip magic bytes, when encountered within the file
after reading a single block, as the start of a new member when
the previous member has ended.
Add test files that reliably reproduce #5852. The gzipped file
in test/fixtures/pseudo-multimember-gzip.gz contains the gzip
magic bytes exactly at the position that node encounters after having
read a single block, leading it to believe that a new data
member is starting.
Fixes: #5852
PR-URL: #5863
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>1 parent 63c601b commit afcd276Copy full SHA for afcd276
File tree
Expand file treeCollapse file tree
4 files changed
+24
-1
lines changedOpen diff view settings
Filter options
- src
- test
- fixtures
- parallel
Expand file treeCollapse file tree
4 files changed
+24
-1
lines changedOpen diff view settings
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
258 | 258 | |
259 | 259 | |
260 | 260 | |
261 | | - |
| 261 | + |
| 262 | + |
262 | 263 | |
263 | 264 | |
264 | 265 | |
|
Binary file not shown.
Binary file not shown.
Collapse file
test/parallel/test-zlib-from-concatenated-gzip.js
Copy file name to clipboardExpand all lines: test/parallel/test-zlib-from-concatenated-gzip.js+22Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
| 7 | + |
| 8 | + |
7 | 9 | |
8 | 10 | |
9 | 11 | |
| ||
16 | 18 | |
17 | 19 | |
18 | 20 | |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
0 commit comments