<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/archive, branch dev.typeparams</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>archive/zip: only preallocate File slice if reasonably sized</title>
<updated>2021-05-25T23:41:42+00:00</updated>
<author>
<name>Roland Shoemaker</name>
<email>roland@golang.org</email>
</author>
<published>2021-05-11T18:31:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=74242baa4136c7a9132a8ccd9881354442788c8c'/>
<id>74242baa4136c7a9132a8ccd9881354442788c8c</id>
<content type='text'>
Since the number of files in the EOCD record isn't validated, it isn't
safe to preallocate Reader.Files using that field. A malformed archive
can indicate it contains up to 1 &lt;&lt; 128 - 1 files. We can still safely
preallocate the slice by checking if the specified number of files in
the archive is reasonable, given the size of the archive.

Thanks to the OSS-Fuzz project for discovering this issue and to
Emmanuel Odeke for reporting it.

Fixes #46242
Fixes CVE-2021-33196

Change-Id: I3c76d8eec178468b380d87fdb4a3f2cb06f0ee76
Reviewed-on: https://go-review.googlesource.com/c/go/+/318909
Trust: Roland Shoemaker &lt;roland@golang.org&gt;
Trust: Katie Hockman &lt;katie@golang.org&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Run-TryBot: Roland Shoemaker &lt;roland@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Katie Hockman &lt;katie@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the number of files in the EOCD record isn't validated, it isn't
safe to preallocate Reader.Files using that field. A malformed archive
can indicate it contains up to 1 &lt;&lt; 128 - 1 files. We can still safely
preallocate the slice by checking if the specified number of files in
the archive is reasonable, given the size of the archive.

Thanks to the OSS-Fuzz project for discovering this issue and to
Emmanuel Odeke for reporting it.

Fixes #46242
Fixes CVE-2021-33196

Change-Id: I3c76d8eec178468b380d87fdb4a3f2cb06f0ee76
Reviewed-on: https://go-review.googlesource.com/c/go/+/318909
Trust: Roland Shoemaker &lt;roland@golang.org&gt;
Trust: Katie Hockman &lt;katie@golang.org&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Run-TryBot: Roland Shoemaker &lt;roland@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Katie Hockman &lt;katie@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/zip: add File.OpenRaw, Writer.CreateRaw, Writer.Copy</title>
<updated>2021-05-03T21:11:47+00:00</updated>
<author>
<name>Eddie Scholtz</name>
<email>escholtz@google.com</email>
</author>
<published>2021-04-21T17:11:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=ddb648fdf6c21e7e56a2252df3e3913a212ca4ab'/>
<id>ddb648fdf6c21e7e56a2252df3e3913a212ca4ab</id>
<content type='text'>
These new methods provide support for cases where performance is a
primary concern. For example, copying files from an existing zip to a
new zip without incurring the decompression and compression overhead.
Using an optimized, external compression method and writing the output
to a zip archive. And compressing file contents in parallel and then
sequentially writing the compressed bytes to a zip archive.

TestWriterCopy is copied verbatim from https://github.com/rsc/zipmerge

Fixes #34974

Change-Id: Iade5bc245ba34cdbb86364bf59f79f38bb9e2eb6
Reviewed-on: https://go-review.googlesource.com/c/go/+/312310
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Carlos Amedee &lt;carlos@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These new methods provide support for cases where performance is a
primary concern. For example, copying files from an existing zip to a
new zip without incurring the decompression and compression overhead.
Using an optimized, external compression method and writing the output
to a zip archive. And compressing file contents in parallel and then
sequentially writing the compressed bytes to a zip archive.

TestWriterCopy is copied verbatim from https://github.com/rsc/zipmerge

Fixes #34974

Change-Id: Iade5bc245ba34cdbb86364bf59f79f38bb9e2eb6
Reviewed-on: https://go-review.googlesource.com/c/go/+/312310
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Carlos Amedee &lt;carlos@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/zip: only return directory once via io/fs.FS</title>
<updated>2021-04-29T19:04:31+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2021-04-19T20:51:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=87e4dcd446df2ab1985ef61ce15da329493248a1'/>
<id>87e4dcd446df2ab1985ef61ce15da329493248a1</id>
<content type='text'>
While we're here fix the ModTime value for directories.

Fixes #43872
Fixes #45345

Change-Id: I155e6517713ef6a9482b9431f1167a44337c6ad2
Reviewed-on: https://go-review.googlesource.com/c/go/+/311530
Trust: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Jeremy Faller &lt;jeremy@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While we're here fix the ModTime value for directories.

Fixes #43872
Fixes #45345

Change-Id: I155e6517713ef6a9482b9431f1167a44337c6ad2
Reviewed-on: https://go-review.googlesource.com/c/go/+/311530
Trust: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Jeremy Faller &lt;jeremy@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/zip: fix imports block of biggestZipBytes generator</title>
<updated>2021-04-18T17:40:12+00:00</updated>
<author>
<name>Paschalis Tsilias</name>
<email>paschalis.tsilias@gmail.com</email>
</author>
<published>2021-04-13T12:51:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=4efd581383ade76c562953289ed8210bb55bff47'/>
<id>4efd581383ade76c562953289ed8210bb55bff47</id>
<content type='text'>
Fixes #45529

Change-Id: I4d64c40aa6733b783dc4066e222f17abeb7ad413
Reviewed-on: https://go-review.googlesource.com/c/go/+/309357
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Trust: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #45529

Change-Id: I4d64c40aa6733b783dc4066e222f17abeb7ad413
Reviewed-on: https://go-review.googlesource.com/c/go/+/309357
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Trust: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/tar: replace os.MkdirTemp with T.TempDir</title>
<updated>2021-04-13T21:06:12+00:00</updated>
<author>
<name>Manlio Perillo</name>
<email>manlio.perillo@gmail.com</email>
</author>
<published>2021-04-13T10:35:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=069983e5db99fa6b94401f971e9c19440615d233'/>
<id>069983e5db99fa6b94401f971e9c19440615d233</id>
<content type='text'>
Updates #45402

Change-Id: I296f8c676c68ed1e10b6ad1a17b5b23d2c395252
Reviewed-on: https://go-review.googlesource.com/c/go/+/309355
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Updates #45402

Change-Id: I296f8c676c68ed1e10b6ad1a17b5b23d2c395252
Reviewed-on: https://go-review.googlesource.com/c/go/+/309355
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/zip: fix character device handling in fileModeToUnixMode</title>
<updated>2021-04-03T20:16:00+00:00</updated>
<author>
<name>Tom Thorogood</name>
<email>me+google@tomthorogood.co.uk</email>
</author>
<published>2021-03-12T13:57:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=dac136f87b9d5fdda9b5c33dfa0f94dc8c9880c7'/>
<id>dac136f87b9d5fdda9b5c33dfa0f94dc8c9880c7</id>
<content type='text'>
The switch case for fs.ModeDevice can only be reached for block devices
while character devices match fs.ModeDevice | fs.ModeCharDevice. This
would cause character devices to wrongly be reported as regular files.

This bug has existed since the switch was first introduced in CL 5624048.

Change-Id: Icdbedb015e5376b385b3115d2e4574daa052f796
Reviewed-on: https://go-review.googlesource.com/c/go/+/300891
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The switch case for fs.ModeDevice can only be reached for block devices
while character devices match fs.ModeDevice | fs.ModeCharDevice. This
would cause character devices to wrongly be reported as regular files.

This bug has existed since the switch was first introduced in CL 5624048.

Change-Id: Icdbedb015e5376b385b3115d2e4574daa052f796
Reviewed-on: https://go-review.googlesource.com/c/go/+/300891
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/zip: fix panic in Reader.Open</title>
<updated>2021-03-10T18:18:28+00:00</updated>
<author>
<name>Roland Shoemaker</name>
<email>roland@golang.org</email>
</author>
<published>2021-03-02T18:00:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=cd3b4ca9f20fd14187ed4cdfdee1a02ea87e5cd8'/>
<id>cd3b4ca9f20fd14187ed4cdfdee1a02ea87e5cd8</id>
<content type='text'>
When operating on a Zip file that contains a file prefixed with "../",
Open(...) would cause a panic in toValidName when attempting to strip
the prefixed path components.

Fixes CVE-2021-27919
Fixes #44916

Change-Id: Ic755d8126cb0897e2cbbdacf572439c38dde7b35
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1004761
Reviewed-by: Filippo Valsorda &lt;valsorda@google.com&gt;
Reviewed-by: Russ Cox &lt;rsc@google.com&gt;
Reviewed-by: Katie Hockman &lt;katiehockman@google.com&gt;
Reviewed-on: https://go-review.googlesource.com/c/go/+/300489
Trust: Katie Hockman &lt;katie@golang.org&gt;
Run-TryBot: Katie Hockman &lt;katie@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Alexander Rakoczy &lt;alex@golang.org&gt;
Reviewed-by: Filippo Valsorda &lt;filippo@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When operating on a Zip file that contains a file prefixed with "../",
Open(...) would cause a panic in toValidName when attempting to strip
the prefixed path components.

Fixes CVE-2021-27919
Fixes #44916

Change-Id: Ic755d8126cb0897e2cbbdacf572439c38dde7b35
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1004761
Reviewed-by: Filippo Valsorda &lt;valsorda@google.com&gt;
Reviewed-by: Russ Cox &lt;rsc@google.com&gt;
Reviewed-by: Katie Hockman &lt;katiehockman@google.com&gt;
Reviewed-on: https://go-review.googlesource.com/c/go/+/300489
Trust: Katie Hockman &lt;katie@golang.org&gt;
Run-TryBot: Katie Hockman &lt;katie@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Alexander Rakoczy &lt;alex@golang.org&gt;
Reviewed-by: Filippo Valsorda &lt;filippo@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: go fmt std cmd (but revert vendor)</title>
<updated>2021-02-20T03:54:50+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2021-02-19T23:35:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=d4b26382342c98a95b85140b2863bc30c48edd68'/>
<id>d4b26382342c98a95b85140b2863bc30c48edd68</id>
<content type='text'>
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/294430
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/294430
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/tar: detect out of bounds accesses in PAX records resulting from padded lengths</title>
<updated>2021-02-09T05:28:50+00:00</updated>
<author>
<name>Emmanuel T Odeke</name>
<email>emmanuel@orijtech.com</email>
</author>
<published>2021-02-04T09:39:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e0ac989cf3e43ec77c7205a66cb1cd63dd4d3043'/>
<id>e0ac989cf3e43ec77c7205a66cb1cd63dd4d3043</id>
<content type='text'>
Handles the case in which padding of a PAX record's length field
violates invariants about the formatting of record, whereby it no
longer matches the prescribed format:

    "%d %s=%s\n", &lt;length&gt;, &lt;keyword&gt;, &lt;value&gt;

as per:

    https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_03

0-padding, and paddings of other sorts weren't handled and we assumed
that only non-padded decimal lengths would be passed in.
Added test cases to ensure that the parsing still proceeds as expected.

The prior crashing repro:

    0000000000000000000000000000000030 mtime=1432668921.098285006\n30 ctime=2147483649.15163319

exposed the fallacy in the code, that assumed that the length would ALWAYS be a
non-padded decimal length string.

This bug has existed since Go1.1 as per CL 6700047.

Thanks to Josh Bleecher Snyder for fuzzing this package, and thanks to Tom
Thorogood for advocacy, raising parity with GNU Tar, but for providing more test cases.

Fixes #40196

Change-Id: I32e0af4887bc9221481bd9e8a5120a79f177f08c
Reviewed-on: https://go-review.googlesource.com/c/go/+/289629
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Handles the case in which padding of a PAX record's length field
violates invariants about the formatting of record, whereby it no
longer matches the prescribed format:

    "%d %s=%s\n", &lt;length&gt;, &lt;keyword&gt;, &lt;value&gt;

as per:

    https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_03

0-padding, and paddings of other sorts weren't handled and we assumed
that only non-padded decimal lengths would be passed in.
Added test cases to ensure that the parsing still proceeds as expected.

The prior crashing repro:

    0000000000000000000000000000000030 mtime=1432668921.098285006\n30 ctime=2147483649.15163319

exposed the fallacy in the code, that assumed that the length would ALWAYS be a
non-padded decimal length string.

This bug has existed since Go1.1 as per CL 6700047.

Thanks to Josh Bleecher Snyder for fuzzing this package, and thanks to Tom
Thorogood for advocacy, raising parity with GNU Tar, but for providing more test cases.

Fixes #40196

Change-Id: I32e0af4887bc9221481bd9e8a5120a79f177f08c
Reviewed-on: https://go-review.googlesource.com/c/go/+/289629
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>archive/tar: fix typo in comment</title>
<updated>2021-01-08T02:03:24+00:00</updated>
<author>
<name>yangwenmai</name>
<email>yangwen.yw@gmail.com</email>
</author>
<published>2021-01-07T09:45:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=d92f8add32f79efe7e46af55172d4c703a778938'/>
<id>d92f8add32f79efe7e46af55172d4c703a778938</id>
<content type='text'>
Change-Id: Ifcc565b34b3c3bb7ee62bb0525648a5d2895bf0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/282013
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Alberto Donizetti &lt;alb.donizetti@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ifcc565b34b3c3bb7ee62bb0525648a5d2895bf0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/282013
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Alberto Donizetti &lt;alb.donizetti@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
