Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5730 invoked from network); 11 Mar 2008 09:42:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2008 09:42:21 -0000 Authentication-Results: pb1.pair.com header.from=jorton@redhat.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jorton@redhat.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain redhat.com designates 66.187.233.31 as permitted sender) X-PHP-List-Original-Sender: jorton@redhat.com X-Host-Fingerprint: 66.187.233.31 mx1.redhat.com Linux 2.6 Received: from [66.187.233.31] ([66.187.233.31:52760] helo=mx1.redhat.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/53-21537-AF356D74 for ; Tue, 11 Mar 2008 04:42:20 -0500 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m2B9gGBo007609 for ; Tue, 11 Mar 2008 05:42:16 -0400 Received: from turnip.manyfish.co.uk (IDENT:U2FsdGVkX18jw0/KmMGnHHiZyTbmh9M9/Kcb+aDDXVU@vpn-14-50.rdu.redhat.com [10.11.14.50]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2B9gFwG008131 for ; Tue, 11 Mar 2008 05:42:15 -0400 Received: from jorton by turnip.manyfish.co.uk with local (Exim 4.68) (envelope-from ) id 1JZ0zu-000542-Vu for internals@lists.php.net; Tue, 11 Mar 2008 09:42:14 +0000 Date: Tue, 11 Mar 2008 09:42:14 +0000 To: internals@lists.php.net Message-ID: <20080311094214.GA4264@redhat.com> Mail-Followup-To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Organization: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in UK and Wales under Company Registration No. 03798903 Directors: Michael Cunningham (USA), Brendan Lane (Ireland), Matt Parson (USA), Charlie Peters (USA) X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Subject: php_stream_cast to fd From: jorton@redhat.com (Joe Orton) When php_stream_cast is passed any of the _AS_FD-like options, what is the ret argument supposed to point to? This does not seem to be decided consistently; from a quick survey: ext/openssl/xp_ssl.c: php_openssl_sockop_cast() presumes that *ret has sizeof(void *) ext/soap/php_http.c: stream_alive() presumes that *ret has sizeof(long) ext/standard/streamfuncs.c: stream_array_from_fd_set() presumes that *ret has sizeof(php_socket_t) main/streams/xp_socket.c: php_sockop_cast() presumes that *ret has sizeof(int) On 64-bit platforms, of course, at least half of these cases will break, since sizeof(int) != sizeof(long). This issue is the cause of http://bugs.php.net/bug.php?id=32979, where a 64-bit value is being written to an pointer to a 32-bit value on the stack, and trashing whatever follows it. joe