Explorar o código

Prevent Read on a closed stream

Armon Dadgar %!s(int64=10) %!d(string=hai) anos
pai
achega
912e29616f
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      stream.go

+ 2 - 0
stream.go

@@ -86,6 +86,8 @@ func (s *Stream) Read(b []byte) (n int, err error) {
 START:
 	s.stateLock.Lock()
 	switch s.state {
+	case streamLocalClose:
+		fallthrough
 	case streamRemoteClose:
 		fallthrough
 	case streamClosed: