aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/encode.go
diff options
context:
space:
mode:
authorPhil Bracikowski <pbracikowski@influxdata.com>2022-03-02 01:51:28 +0000
committerJoseph Tsai <joetsai@digital-static.net>2022-03-02 17:03:04 +0000
commit4a13f6f42ded127dc0d097f7d1f89916cbd9e729 (patch)
treedcc93b362e88859cae1dfdef56d0876a84b2040e /src/encoding/json/encode.go
parentf79a983891123f57dd7d37d09a51a287ac6d4cad (diff)
downloadgo-4a13f6f42ded127dc0d097f7d1f89916cbd9e729.tar.xz
compress/gzip: return unexpected EOF for certain truncated streams
For cases where RFC 1952 requires a field, the code returns the error io.ErrUnexpectedEOF except in two places: for the FNAME flag or the FCOMMENT flag. These flags expect a null-terminated string and readString may return an EOF if the Reader is truncated before a null byte is found. For consistency with parsing other parts of the header, this is converted to an unexpected EOF herein. Follow-up to CL 14832. Fixes #51417 Change-Id: I173283a6ae309e4a8e52fc15df404ce5db06eff1 GitHub-Last-Rev: 2e573cd961c0b1e4296fbde53097cf5723a2ca29 GitHub-Pull-Request: golang/go#51418 Reviewed-on: https://go-review.googlesource.com/c/go/+/389034 Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Trust: Joseph Tsai <joetsai@digital-static.net> Trust: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/encoding/json/encode.go')
0 files changed, 0 insertions, 0 deletions