]> Cypherpunks repositories - gostls13.git/commit
net/http: fix nil body causing ParseMultipartForm to panic
authorhopehook <hopehook.com@gmail.com>
Wed, 9 Feb 2022 12:20:06 +0000 (20:20 +0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 22 Mar 2022 15:16:23 +0000 (15:16 +0000)
commiteca0d44cec58951fb716e540dcc21c0f527686d5
treebe5e6f43ad048525121bccb244dc47f141d37dd0
parent96567fb3ccdc8d8c052606112db7b39abd725b59
net/http: fix nil body causing ParseMultipartForm to panic

ParseMultipartForm relies on a valid multipartReader, if the request body is nil,
the multipartReader should return an error. This way ParseMultipartForm can return
an error instead of causing mr.ReadForm(maxMemory) to panic

Fixes #48206

Change-Id: Ief906f2340c7ab29cacbd5f56892117202a0b911
Reviewed-on: https://go-review.googlesource.com/c/go/+/384454
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/request.go