]> Cypherpunks repositories - gostls13.git/commit
net/http: test that ParseMultipartForm catches overflows
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Tue, 20 Oct 2020 11:11:12 +0000 (04:11 -0700)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Wed, 21 Oct 2020 23:05:41 +0000 (23:05 +0000)
commit4e5a313524da62600eb59dbf98624cfe946456f8
treea2a6a20a38b0cfd0245d5ba588d203faf64d3bac
parentb2a8317b31d652b3ee293a313269b8290bcdf96c
net/http: test that ParseMultipartForm catches overflows

Tests that if the combination of:
* HTTP multipart file payload size
* ParseMultipartForm's maxMemory parameter
* the internal leeway buffer size of 10MiB

overflows, then we'll report an overflow instead of silently
passing.

Reapplies and fixes CL 254977, which was reverted in CL 263658.

The prior test lacked a res.Body.Close(), so fixed that and
added a leaked Transport check to verify correctness.

Updates 40430.

Change-Id: I3c0f7ef43d621f6eb00f07755f04f9f36c51f98f
Reviewed-on: https://go-review.googlesource.com/c/go/+/263817
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Damien Neil <dneil@google.com>
src/net/http/request_test.go