Fix a nil pointer dereference error that occurs in tcpReader's Read method (#1090)

* Fix a `nil pointer dereference` error that occurs in `tcpReader`'s `Read` method

* #run_acceptance_tests

* #run_acceptance_tests

* Revert "Fix a `nil pointer dereference` error that occurs in `tcpReader`'s `Read` method"

This reverts commit ccef6cb393.

* Fix the race condition using locks #run_acceptance_tests
This commit is contained in:
M. Mert Yıldıran
2022-05-17 03:13:50 -07:00
committed by GitHub
parent 8418802c7e
commit fc194354bc
2 changed files with 7 additions and 1 deletions

View File

@@ -72,8 +72,10 @@ func (t *tcpStream) SetProtocol(protocol *api.Protocol) {
t.protocol = protocol
// Clean the buffers
t.Lock()
t.client.msgBufferMaster = make([]api.TcpReaderDataMsg, 0)
t.server.msgBufferMaster = make([]api.TcpReaderDataMsg, 0)
t.Unlock()
}
func (t *tcpStream) GetOrigin() api.Capture {