Skip to content

Commit e15eac2

Browse files
committed
Skip null byte padding
1 parent a88ca91 commit e15eac2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/StreamReader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private function readHeader(): Header
173173
case 'x':
174174
$paxHeader = $header;
175175
$paxData = fread($this->stream, $paxHeader->getSize()); // @phpstan-ignore argument.type
176+
fseek($this->stream, 512 - ($paxHeader->getSize() % 512), SEEK_CUR); // Skip null byte padding
176177
if ($paxData === false) {
177178
throw new InvalidArchiveFormatException(
178179
'Invalid TAR archive format: Unexpected end of file, expected PAX header data'

0 commit comments

Comments
 (0)