The ZIP format uses uint16 to contain the length of the file name and the length of the Extra section. We should verify that that the length of these fields fits in an uint16 prior to writing the ZIP file.
See
|
b.uint16(uint16(len(h.Name))) |
|
b.uint16(uint16(len(h.Extra))) |
|
if _, err := w.Write(buf[:]); err != nil { |
|
return err |
|
} |
|
if _, err := io.WriteString(w, h.Name); err != nil { |
|
return err |
|
} |
|
_, err := w.Write(h.Extra) |
The ZIP format uses uint16 to contain the length of the file name and the length of the Extra section. We should verify that that the length of these fields fits in an uint16 prior to writing the ZIP file.
See
go/src/archive/zip/writer.go
Lines 271 to 279 in 4c79ed5