pyftdi icon indicating copy to clipboard operation
pyftdi copied to clipboard

BitSequence:_update_length() can result in _seq larger than length

Open jtlongino opened this issue 3 years ago • 1 comments

If a BitSequence is instantiated from a bytearray and a length between len(bytearray) * 8 and (len(bytearray) - 1) * 8, the returned BitSequence has len(BitSequence) that doesn't match length.

ba = bytearray(b'\x01\x01') bs = BitSequence(bytes_=foo, length=10) len(bs) # returns 16, should return 10

jtlongino avatar Apr 15 '21 14:04 jtlongino

I have not use MPPSE/JTAG for a very long time w/ PyFtdi.

I would likely accept patches through pull request, as long as there is a test that demonstrates the validity of the change (or the actual behavior being incorrect), as I do not have a way to validate the changes otherwise.

Thanks.

eblot avatar May 04 '21 17:05 eblot