Skip to content

Commit 76579c0

Browse files
committed
Fix unaligned access in convertsimple().
Like python#6123 this pointer may be unaligned, so a memcpy() instead of simple assignment is required for strict architectures e.g. sparc.
1 parent 47e3562 commit 76579c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/getargs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
919919
if (*format == '#') {
920920
REQUIRE_PY_SSIZE_T_CLEAN;
921921
Py_ssize_t *psize = va_arg(*p_va, Py_ssize_t*);
922-
*psize = count;
922+
memcpy(psize, &count, sizeof(Py_ssize_t));
923923
format++;
924924
} else {
925925
if (strlen(*p) != (size_t)count) {

0 commit comments

Comments
 (0)