]> granicus.if.org Git - python/commitdiff
bpo-8677: use PY_SSIZE_T_CLEAN in socketmodule.c (GH-12467)
authorInada Naoki <songofacandy@gmail.com>
Wed, 20 Mar 2019 10:02:46 +0000 (19:02 +0900)
committerGitHub <noreply@github.com>
Wed, 20 Mar 2019 10:02:46 +0000 (19:02 +0900)
Modules/socketmodule.c

index 1120f6b51325a0b0c54e37f7444227a57ebe20f0..b48f8a9c30935aec48aebe9a651af2d180e7086b 100644 (file)
@@ -99,6 +99,7 @@ Local naming conventions:
 # pragma weak inet_aton
 #endif
 
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
 
@@ -1414,7 +1415,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
                              a->sll_pkttype,
                              a->sll_hatype,
                              a->sll_addr,
-                             a->sll_halen);
+                             (Py_ssize_t)a->sll_halen);
     }
 #endif /* HAVE_NETPACKET_PACKET_H && SIOCGIFNAME */