Merge pull request #419 from japhlange/netlist

netstat: fixes two off-by-one errors in port bitmap parsing
This commit is contained in:
ikelos
2021-01-10 16:30:02 +00:00
committed by GitHub
@@ -94,10 +94,10 @@ class NetStat(interfaces.plugins.PluginInterface, timeliner.TimeLinerInterface):
The list of indices at which a 1 was found.
"""
ret = []
for idx in range(bitmap_size_in_byte-1):
for idx in range(bitmap_size_in_byte):
current_byte = context.layers[layer_name].read(bitmap_offset + idx, 1)[0]
current_offs = idx * 8
for bit in range(7):
for bit in range(8):
if current_byte & (1 << bit) != 0:
ret.append(bit + current_offs)
return ret