diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-07-29 12:37:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-07-29 12:37:17 (GMT) |
commit | e97944a27e836f68f6b42393885999f3bcdce36b (patch) | |
tree | b0e9e13169005cefea145d3b67811613b2198dd1 /Modules | |
parent | 2f2c829688a42828d2be85118d26ea5bb41266eb (diff) | |
download | cpython-e97944a27e836f68f6b42393885999f3bcdce36b.zip cpython-e97944a27e836f68f6b42393885999f3bcdce36b.tar.gz cpython-e97944a27e836f68f6b42393885999f3bcdce36b.tar.bz2 |
Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
written by Matthieu Gautier.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/cfield.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 76c72f8..85b5ad2 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -769,6 +769,7 @@ I_set_sw(void *ptr, PyObject *value, Py_ssize_t size) if (get_ulong(value, &val) < 0) return NULL; memcpy(&field, ptr, sizeof(field)); + field = SWAP_INT(field); field = SET(unsigned int, field, (unsigned int)val, size); field = SWAP_INT(field); memcpy(ptr, &field, sizeof(field)); |