From 8e08da18893264615a88b3f10469a190de3c4e07 Mon Sep 17 00:00:00 2001 From: vhqtvn Date: Wed, 16 Dec 2020 01:52:48 +0700 Subject: [PATCH] fix crash when socket_listener receiving invalid data (#8551) Co-authored-by: Hoa Nguyen Van --- plugins/inputs/socket_listener/socket_listener.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/inputs/socket_listener/socket_listener.go b/plugins/inputs/socket_listener/socket_listener.go index e412996f38e6e..15c6f18e1e1dc 100644 --- a/plugins/inputs/socket_listener/socket_listener.go +++ b/plugins/inputs/socket_listener/socket_listener.go @@ -114,6 +114,7 @@ func (ssl *streamSocketListener) read(c net.Conn) { decoder, err := internal.NewStreamContentDecoder(ssl.ContentEncoding, c) if err != nil { ssl.Log.Error("Read error: %v", err) + return } scnr := bufio.NewScanner(decoder)