<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/net/textproto/reader.go, branch json-isValidNumber</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=json-isValidNumber</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=json-isValidNumber'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2023-02-14T16:51:18Z</updated>
<entry>
<title>mime/multipart: limit memory/inode consumption of ReadForm</title>
<updated>2023-02-14T16:51:18Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2023-01-25T17:27:01Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=0af2c78c362481e45339b76d0a210bf462cfe65c'/>
<id>urn:sha1:0af2c78c362481e45339b76d0a210bf462cfe65c</id>
<content type='text'>
Reader.ReadForm is documented as storing "up to maxMemory bytes + 10MB"
in memory. Parsed forms can consume substantially more memory than
this limit, since ReadForm does not account for map entry overhead
and MIME headers.

In addition, while the amount of disk memory consumed by ReadForm can
be constrained by limiting the size of the parsed input, ReadForm will
create one temporary file per form part stored on disk, potentially
consuming a large number of inodes.

Update ReadForm's memory accounting to include part names,
MIME headers, and map entry overhead.

Update ReadForm to store all on-disk file parts in a single
temporary file.

Files returned by FileHeader.Open are documented as having a concrete
type of *os.File when a file is stored on disk. The change to use a
single temporary file for all parts means that this is no longer the
case when a form contains more than a single file part stored on disk.

The previous behavior of storing each file part in a separate disk
file may be reenabled with GODEBUG=multipartfiles=distinct.

Update Reader.NextPart and Reader.NextRawPart to set a 10MiB cap
on the size of MIME headers.

Thanks to Jakob Ackermann (@das7pad) for reporting this issue.

Fixes #58006
Fixes CVE-2022-41725

Change-Id: Ibd780a6c4c83ac8bcfd3cbe344f042e9940f2eab
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1714276
Reviewed-by: Julie Qiu &lt;julieqiu@google.com&gt;
TryBot-Result: Security TryBots &lt;security-trybots@go-security-trybots.iam.gserviceaccount.com&gt;
Reviewed-by: Roland Shoemaker &lt;bracewell@google.com&gt;
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
Reviewed-on: https://go-review.googlesource.com/c/go/+/468124
Auto-Submit: Michael Pratt &lt;mpratt@google.com&gt;
Run-TryBot: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Than McIntosh &lt;thanm@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>net/textproto: reject invalid header keys/values in ReadMIMEHeader</title>
<updated>2022-11-08T20:36:15Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2022-06-06T20:54:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=a6642e67e16b9d769a0c08e486ba08408064df19'/>
<id>urn:sha1:a6642e67e16b9d769a0c08e486ba08408064df19</id>
<content type='text'>
Return an error when parsing a MIME header containing bytes in the
key or value outside the set allowed by RFC 7230.

For historical compatibility, accept spaces in keys (but do not
canonicalize the key in this case).

For #53188.

Change-Id: I195319362a2fc69c4e506644f78c5026db070379
Reviewed-on: https://go-review.googlesource.com/c/go/+/410714
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
</content>
</entry>
<entry>
<title>net/textproto: use bytes.Clone</title>
<updated>2022-09-28T03:55:14Z</updated>
<author>
<name>cuiweixie</name>
<email>cuiweixie@gmail.com</email>
</author>
<published>2022-09-27T16:31:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=acc5e3a0c20432199181fef2bc6204fbd11d21d0'/>
<id>urn:sha1:acc5e3a0c20432199181fef2bc6204fbd11d21d0</id>
<content type='text'>
Change-Id: Ic73d667a98df3f2d1705a67e7e8625c6ba65cc0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/435284
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Auto-Submit: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
Run-TryBot: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
</content>
</entry>
<entry>
<title>all: gofmt main repo</title>
<updated>2022-04-11T16:34:30Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-02-03T19:12:08Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=19309779ac5e2f5a2fd3cbb34421dafb2855ac21'/>
<id>urn:sha1:19309779ac5e2f5a2fd3cbb34421dafb2855ac21</id>
<content type='text'>
[This CL is part of a sequence implementing the proposal #51082.
The design doc is at https://go.dev/s/godocfmt-design.]

Run the updated gofmt, which reformats doc comments,
on the main repository. Vendored files are excluded.

For #51082.

Change-Id: I7332f099b60f716295fb34719c98c04eb1a85407
Reviewed-on: https://go-review.googlesource.com/c/go/+/384268
Reviewed-by: Jonathan Amsterdam &lt;jba@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>net/textproto: initialize commonHeader in canonicalMIMEHeaderKey</title>
<updated>2022-04-08T21:40:11Z</updated>
<author>
<name>Johan Jansson</name>
<email>johan.jansson@iki.fi</email>
</author>
<published>2022-04-01T11:00:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=db576c9f3a33d043b4dc6cd8177f4e0b25ded8ec'/>
<id>urn:sha1:db576c9f3a33d043b4dc6cd8177f4e0b25ded8ec</id>
<content type='text'>
Call initCommonHeader in canonicalMIMEHeaderKey to ensure that
commonHeader is initialized before use. Remove all other calls to
initCommonHeader, since commonHeader is only used in
canonicalMIMEHeaderKey.

This prevents a race condition: read of commonHeader before
commonHeader has been initialized.

Add regression test that triggers the race condition which can be
detected by the race detector.

Fixes #46363

Change-Id: I00c8c52c6f4c78c0305978c876142c1b388174af
Reviewed-on: https://go-review.googlesource.com/c/go/+/397575
Trust: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
Trust: Bryan Mills &lt;bcmills@google.com&gt;
Run-TryBot: Bryan Mills &lt;bcmills@google.com&gt;
Auto-Submit: Bryan Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>all: remove trailing blank doc comment lines</title>
<updated>2022-04-01T18:18:07Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-01-31T01:11:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=690ac4071fa3e07113bf371c9e74394ab54d6749'/>
<id>urn:sha1:690ac4071fa3e07113bf371c9e74394ab54d6749</id>
<content type='text'>
A future change to gofmt will rewrite

	// Doc comment.
	//
	func f()

to

	// Doc comment.
	func f()

Apply that change preemptively to all doc comments.

For #51082.

Change-Id: I4023e16cfb0729b64a8590f071cd92f17343081d
Reviewed-on: https://go-review.googlesource.com/c/go/+/384259
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>all: use bytes.Cut, strings.Cut</title>
<updated>2021-10-06T15:53:04Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2021-09-22T14:46:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=4d8db00641cc9ff4f44de7df9b8c4f4a4f9416ee'/>
<id>urn:sha1:4d8db00641cc9ff4f44de7df9b8c4f4a4f9416ee</id>
<content type='text'>
Many uses of Index/IndexByte/IndexRune/Split/SplitN
can be written more clearly using the new Cut functions.
Do that. Also rewrite to other functions if that's clearer.

For #46336.

Change-Id: I68d024716ace41a57a8bf74455c62279bde0f448
Reviewed-on: https://go-review.googlesource.com/c/go/+/351711
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: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>all: update references to symbols moved from io/ioutil to io</title>
<updated>2020-10-20T18:41:18Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2020-10-16T04:49:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=1b09d430678d4a6f73b2443463d11f75851aba8a'/>
<id>urn:sha1:1b09d430678d4a6f73b2443463d11f75851aba8a</id>
<content type='text'>
The old ioutil references are still valid, but update our code
to reflect best practices and get used to the new locations.

Code compiled with the bootstrap toolchain
(cmd/asm, cmd/dist, cmd/compile, debug/elf)
must remain Go 1.4-compatible and is excluded.
Also excluded vendored code.

For #41190.

Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/263142
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: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
</content>
</entry>
<entry>
<title>net/textproto: correct documentation of empty line handling</title>
<updated>2020-07-09T20:09:55Z</updated>
<author>
<name>Norman B. Lancaster</name>
<email>qbradq@gmail.com</email>
</author>
<published>2019-07-10T22:31:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=504db532971b703d52f0bd4ced3e36a403b49da4'/>
<id>urn:sha1:504db532971b703d52f0bd4ced3e36a403b49da4</id>
<content type='text'>
Fixes #32493

Change-Id: I9c93791c4cc5c0c14556802733066407de3181ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/185542
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>net/textproto: pass missing argument to fmt.Sprintf</title>
<updated>2020-03-01T02:13:41Z</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2020-02-27T02:34:25Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=33e98326a25d54cef19e94ca73c45eaed8847f56'/>
<id>urn:sha1:33e98326a25d54cef19e94ca73c45eaed8847f56</id>
<content type='text'>
The vet tool didn't catch this because the fmt.Sprintf format argument
was written as an expression.

Fixes #37467

Change-Id: I72c20ba45e3f42c195fa5e68adcdb9837c7d7ad5
Reviewed-on: https://go-review.googlesource.com/c/go/+/221297
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
</content>
</entry>
</feed>
