[mirror] Go supplementary network libraries
Перейти к файлу
Brad Fitzpatrick 62685c2d7c http2: fix crash in Transport on double Read of invalid gzip Response.Body
This old code was buggy:

type gzipReader struct {
        body io.ReadCloser // underlying Response.Body
        zr   io.Reader     // lazily-initialized gzip reader
}

func (gz *gzipReader) Read(p []byte) (n int, err error) {
        if gz.zr == nil {
                gz.zr, err = gzip.NewReader(gz.body)
                if err != nil {
                        return 0, err
                }
        }
        return gz.zr.Read(p)
}

If a Read on a gzipped Response.Body (of type *http2.gzipReader)
resulted in gzip.NewReader returning an error, gzipReader assigned
a *gzip.Reader-typed nil value to the gz.zr interface value.

On a subsequent Read, gz.zr would not be equal to ==, because it was
actually equal to (type *gzip.Reader, nil), and then zr.Read would call
(*gzip.Reader).Read with a nil receiver and explode.

Debugged internally. (http://go/http2gzipbug)

Change-Id: Icba040ace8ffac3536e5e7ade6695c7660838ca1
2016-02-13 02:03:29 +00:00
context net/context/ctxhttp: fix case where Body could leak and not be closed 2016-01-26 03:35:23 +00:00
dict net: add import comments. 2014-12-09 14:17:11 +11:00
html html/charset: replace EUC-KR test 2016-01-08 17:00:32 +00:00
http2 http2: fix crash in Transport on double Read of invalid gzip Response.Body 2016-02-13 02:03:29 +00:00
icmp icmp: fix typo. 2016-01-15 04:49:47 +00:00
idna net: add import comments. 2014-12-09 14:17:11 +11:00
internal internal/iana: update protocol numbers 2015-07-24 21:59:50 +00:00
ipv4 ipv4: update example for the use of dual stack listener 2015-12-15 03:16:29 +00:00
ipv6 ipv6: update example for the use of dual stack listener 2015-12-15 03:17:52 +00:00
netutil netutil: Ditch go1.3 build tag. 2015-12-14 00:45:27 +00:00
proxy net: add import comments. 2014-12-09 14:17:11 +11:00
publicsuffix publicsuffix: add some commentary on using "go run gen.go". 2016-02-11 08:08:07 +00:00
trace trace: properly set the content type when sending html 2016-01-04 18:49:02 +00:00
webdav webdav: fix props for directory 2015-12-11 09:22:36 +00:00
websocket websocket: don't send IPv6 zone identifier in outbound request, per RFC 6874 2015-08-13 11:46:27 +00:00
xsrftoken xsrftoken: fix lint error in Timeout's comment. 2015-12-14 00:16:29 +00:00
.gitattributes net: add .gitattributes (fixes windows build) 2014-12-23 17:05:08 +11:00
.gitignore convert .hgignore to .gitignore. 2014-12-08 10:44:07 +11:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
CONTRIBUTING.md doc: add CONTRIBUTING.md 2015-02-18 23:42:41 +00:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:00 +11:00
PATENTS go.net: add PATENTS file to the subrepo. 2012-04-16 11:24:46 +10:00
README go.net: initial code 2012-01-25 15:31:30 -05:00
codereview.cfg net: add codereview.cfg 2015-03-18 17:04:12 +00:00

README

This repository holds supplementary Go networking libraries.

To submit changes to this repository, see http://golang.org/doc/contribute.html.