mirror of
https://github.com/python/cpython.git
synced 2025-09-17 14:16:02 +00:00
Fix issue 4884, preventing a crash in the socket code when python is compiled
with llvm-gcc and run with a glibc <2.10.
This commit is contained in:
parent
343b970da9
commit
d89f5b20b2
2 changed files with 14 additions and 1 deletions
|
@ -3334,7 +3334,11 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
|
|||
#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
|
||||
struct hostent_data data;
|
||||
#else
|
||||
char buf[16384];
|
||||
/* glibcs up to 2.10 assume that the buf argument to
|
||||
gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc
|
||||
does not ensure. The attribute below instructs the compiler
|
||||
to maintain this alignment. */
|
||||
char buf[16384] Py_ALIGNED(8);
|
||||
int buf_len = (sizeof buf) - 1;
|
||||
int errnop;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue