From: Yves Orton Date: Wed, 20 Jun 2007 15:22:31 +0000 (+0200) Subject: Re: Net::SMTP can't send large messages with bleadperl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69a143a617ef4a2e1a3b3a29a66e4b9c956cf3ca;p=p5sagit%2Fp5-mst-13.2.git Re: Net::SMTP can't send large messages with bleadperl Message-ID: <9b18b3110706200622o344c417apbd50468c6e5eb533@mail.gmail.com> p4raw-id: //depot/perl@31426 --- diff --git a/win32/win32sck.c b/win32/win32sck.c index 2795104..8656c0b 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -666,15 +666,19 @@ int win32_ioctl(int i, unsigned int u, char *data) { dTHX; - u_long argp = (u_long)data; + u_long u_long_arg; int retval; - + if (!wsock_started) { Perl_croak_nocontext("ioctl implemented only on sockets"); /* NOTREACHED */ } - retval = ioctlsocket(TO_SOCKET(i), (long)u, &argp); + /* mauke says using memcpy avoids alignment issues */ + memcpy(&u_long_arg, data, sizeof u_long_arg); + retval = ioctlsocket(TO_SOCKET(i), (long)u, &u_long_arg); + memcpy(data, &u_long_arg, sizeof u_long_arg); + if (retval == SOCKET_ERROR) { if (WSAGetLastError() == WSAENOTSOCK) { Perl_croak_nocontext("ioctl implemented only on sockets");