fix(inputs.s7comm): Truncate strings to reported length (#14283)

This commit is contained in:
phagemann 2023-11-13 23:12:09 +01:00 committed by GitHub
parent e57da21f83
commit fd65ce80d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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])