mirror of
https://github.com/arendst/Tasmota.git
synced 2026-10-26 22:11:22 +00:00
Matter: encode strings longer than 255 bytes (#25185)
Matter_TLV.tlv2raw() wrote a UTF2 string with bytes().frostring(), a typo for fromstring(), so encoding any string of more than 255 bytes (which is given type UTF2 automatically) raised attribute_error.
This commit is contained in:
1 parent
e1325dd292
commit
06d51e8fc2
1 file changed
+1
-1
@@ -375,7 +375,7 @@ class Matter_TLV
|
||||
elif self.typ == 0x0D #-TLV.UTF2-#
|
||||
if size(self.val) > 65535 raise "value_error", "string too big" end
|
||||
b.add(size(self.val), 2)
|
||||
b..bytes().frostring(str(self.val))
|
||||
b..bytes().fromstring(str(self.val))
|
||||
elif self.typ == 0x10 #-TLV.B1-#
|
||||
if size(self.val) > 255 raise "value_error", "bytes too big" end
|
||||
b.add(size(self.val), 1)
|
||||
|
||||
Reference in new issue
Block a user