From fd65ce80d89d073a55dc74f21c4ba997468f01ab Mon Sep 17 00:00:00 2001 From: phagemann Date: Mon, 13 Nov 2023 23:12:09 +0100 Subject: [PATCH] fix(inputs.s7comm): Truncate strings to reported length (#14283) --- plugins/inputs/s7comm/type_conversions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/s7comm/type_conversions.go b/plugins/inputs/s7comm/type_conversions.go index 94c44e9cf..43119393d 100644 --- a/plugins/inputs/s7comm/type_conversions.go +++ b/plugins/inputs/s7comm/type_conversions.go @@ -29,7 +29,7 @@ func determineConversion(dtype string) converterFunc { return "" } // Get the length of the encoded string - length := int(buf[0]) + length := int(buf[1]) // Clip the string if we do not fill the whole buffer if length < len(buf)-2 { return string(buf[2 : 2+length])