Open
Description
Bug report
Bug description:
from ctypes import BigEndianStructure, c_char
class MRE(BigEndianStructure):
_fields_ = [
("bugged", c_char*4)
]
value = b"\x11"*2 + b"\00" + b"\xFF"
mre = MRE(bugged=value)
print(mre.bugged) # b'\x11\x11' but expected to be b'\x11\x11\x00\xff'
Looks like there is a problem with NULL-terminator somewhere.
CPython versions tested on:
3.11
Operating systems tested on:
Windows