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:
parent
379cb16efe
commit
92736b2677
|
@ -542,8 +542,11 @@ func (w *h2DictWriter) Write(p []byte) (n int, err error) {
|
|||
}
|
||||
|
||||
func (w *h2DictWriter) Close() error {
|
||||
if w.comp != nil {
|
||||
return w.comp.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// From http2/hpack
|
||||
func http2ReadVarInt(n byte, p []byte) (remain []byte, v uint64, err error) {
|
||||
|
|
Loading…
Reference in New Issue