]> Cypherpunks repositories - gostls13.git/commit
archive/zip: fix Writer to validate file
authorAudrey Lim <audreylh@gmail.com>
Sat, 15 Jul 2017 18:33:06 +0000 (12:33 -0600)
committerJoe Tsai <thebrokentoaster@gmail.com>
Sun, 13 Aug 2017 17:33:10 +0000 (17:33 +0000)
commit816deacc70f48d14638104e284b3b75d5b1e8036
tree5dae6e536ef454c34d8ac269465cef8a69b3f5f3
parent09ed0f68059552abeeae78867ffc2956205df22a
archive/zip: fix Writer to validate file

The ZIP format uses uint16 to contain the length of the file name and
the length of the Extra section. This change verifies that the length
of these fields fit in an uint16 prior to writing the ZIP file. If not,
an error is returned.

Fixes #17402

Change-Id: Ief9a864d2fe16b89ddb9917838283b801a2c58a4
Reviewed-on: https://go-review.googlesource.com/50250
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/archive/zip/writer.go
src/archive/zip/zip_test.go