mirror of
https://opendev.org/x/pyghmi
synced 2026-04-01 15:53:32 +00:00
Remove null bytes within a string
Null bytes have been observed within strings, remove them to avoid the binary data in the output. Change-Id: I651038c45ec346e66b4026c28c72499af8f378df
This commit is contained in:
@@ -229,6 +229,7 @@ class FRU(object):
|
||||
# Additionally 0xfe has been observed, which should be a thorn, but
|
||||
# again assuming termination of string is more likely than thorn.
|
||||
retinfo = retinfo.rstrip(b'\xfe\xff\x10\x03\x00 ')
|
||||
retinfo = retinfo.replace(b'\x00', b'')
|
||||
if lang in (0, 25):
|
||||
try:
|
||||
retinfo = retinfo.decode('iso-8859-1')
|
||||
|
||||
Reference in New Issue
Block a user