Message234682
| Author |
mgautierfr |
| Recipients |
mgautierfr |
| Date |
2015年01月25日.18:53:36 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1422212017.26.0.671058309435.issue23319@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I_set_sw function is missing a SWAP_INT.
This leads to wrong set of bitfield value.
Here is a script to reproduce:
----------
from ctypes import *
class HEADER(BigEndianStructure):
_fields_ = ( ('pad', c_uint32, 16),
('v1', c_uint32, 4),
('v2', c_uint32, 12)
)
b = bytearray(4)
header = HEADER.from_buffer(b)
header.type = 1
assert b == b'\x00\x00\x10\x00'
header.mode = 0x234
assert b == b'\x00\x00\x12\x34'
---------- |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年01月25日 18:53:37 | mgautierfr | set | recipients:
+ mgautierfr |
| 2015年01月25日 18:53:37 | mgautierfr | set | messageid: <1422212017.26.0.671058309435.issue23319@psf.upfronthosting.co.za> |
| 2015年01月25日 18:53:37 | mgautierfr | link | issue23319 messages |
| 2015年01月25日 18:53:37 | mgautierfr | create |
|