1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-13 06:50:29 +08:00

bug(cloudflared): nil pointer deference on h2DictWriter Close() (#154)

Unlike other h2DictWriter methods, the Close() method does check whether
w.comp is nil.

This PR adds a check for non nil compressor before attempting to close

Bug: #141
This commit is contained in:
Tim Bart
2019-12-03 04:29:40 -08:00
committed by Silver
parent 379cb16efe
commit 92736b2677

View File

@@ -542,7 +542,10 @@ func (w *h2DictWriter) Write(p []byte) (n int, err error) {
} }
func (w *h2DictWriter) Close() error { func (w *h2DictWriter) Close() error {
return w.comp.Close() if w.comp != nil {
return w.comp.Close()
}
return nil
} }
// From http2/hpack // From http2/hpack