Prevent NPE if multipart form is empty #13

Merged
lunny merged 2 commits from zeripath/binding:prevent-panic-with-empty-multipart-form into master 2022-10-13 10:45:18 +00:00

2 Commits

Author SHA1 Message Date
4cb1bae3ff Merge branch 'master' into prevent-panic-with-empty-multipart-form
All checks were successful
continuous-integration/drone/pr Build is passing
2022-10-09 20:28:24 +08:00
f995d8c90c
Prevent NPE if multipart form is empty
Some checks failed
continuous-integration/drone/pr Build is failing
In https://github.com/go-gitea/gitea/issues/19698 a fuzzer has passed an
empty multipart form which causes go-chi/binding to throw an NPE.

This PR simply protects against this by checking if the multipart form is nil
before trying to map it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-10-09 13:27:44 +01:00