Fix ADVERT_PATH parsing of zero bytes

Preserve valid 0x00 bytes in ADVERT_PATH data by reading the exact number of path bytes instead of stripping all zero bytes.
This commit is contained in:
ErikBrown2
2026-08-30 12:45:01 +02:00
committed by GitHub
parent af64ace4d7
commit 35e483e312
+2 -1
View File
@@ -149,7 +149,8 @@ class MessageReader:
else:
r["path_hash_mode"] = plen >> 6 # 2 upper bytes
r["path_len"] = plen & 0x3F
r["path"] = dbuf.read().replace(b"\0", b"").hex()
path_byte_count = r["path_len"] * (r["path_hash_mode"] + 1)
r["path"] = dbuf.read(path_byte_count).hex()
await self.dispatcher.dispatch(Event(EventType.ADVERT_PATH, r))