Skip to content

Commit 5f0a05a

Browse files
Fix sendmsg re-entrant ancillary mutation crash
1 parent ff8af98 commit 5f0a05a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Modules/socketmodule.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5017,7 +5017,11 @@ _socket_socket_sendmsg_impl(PySocketSockObject *s, PyObject *data_arg,
50175017

50185018
bufsize = cmsgs[ncmsgbufs++].data.len;
50195019

5020-
if(!get_CMSG_SPACE(bufsize, &space)){
5020+
#ifdef CMSG_SPACE
5021+
if (!get_CMSG_SPACE(bufsize, &space)) {
5022+
#else
5023+
if (!get_CMSG_LEN(bufsize, &space)) {
5024+
#endif
50215025
PyErr_SetString(PyExc_OSError, "ancillary data item too large");
50225026
goto finally;
50235027
}

0 commit comments

Comments
 (0)