Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15890 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47670 invoked by uid 1010); 7 Apr 2005 07:40:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47655 invoked from network); 7 Apr 2005 07:40:53 -0000 Received: from unknown (HELO gateway.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2005 07:40:53 -0000 X-Host-Fingerprint: 80.190.230.99 www.troja.net Linux 2.4/2.6 Received: from ([80.190.230.99:32771] helo=mail.troja.net) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id 69/0B-19272-404E4524 for ; Thu, 07 Apr 2005 03:40:53 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 2826DD280 for ; Thu, 7 Apr 2005 09:40:42 +0200 (CEST) Received: from mail.troja.net ([127.0.0.1]) by localhost (cyca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20319-06 for ; Thu, 7 Apr 2005 09:40:37 +0200 (CEST) Received: from vega.php.net (unknown [134.102.249.81]) (using SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTP id 929A595EA for ; Thu, 7 Apr 2005 09:40:37 +0200 (CEST) Message-ID: <6.2.0.14.0.20050407093245.0385c520@127.0.0.1> X-Mailer: QUALCOMM Windows Eudora Version 6.2.0.14 Date: Thu, 07 Apr 2005 09:40:43 +0200 To: internals@lists.php.net Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_141000588==_" X-Virus-Scanned: by amavisd-new at troja.net Subject: [PATCH] fix crash in solaris when fdopen() fails From: thetaphi@php.net (Uwe Schindler) --=====================_141000588==_ Content-Type: text/plain; charset="us-ascii"; format=flowed I am fixing bug #32614: Problem, on the solaris platform fdopen() can fail even if fd is a correct file descriptor, when fd>255 (the well-known solaris stdio problem). The webserver of the user crashes because the return value of fdopen() is not checked for NULL when casting a stream from posix to stdio. After this fd==-1 and fp==NULL ==> further calls to fread/fwrite with this fp segfault. I committed the patches for PHP but I have no karme for "ZendEngine2". Can someone with karma submit this patch? According to this it would be interesting, WHEN some PHP/Zend code tries to cast a POSIX stream to stdio? In which extension/functions? Can this be fixed to only use posix IO? The zend engine itself should be safe since 4.3.3 and since PHP5. Does stream casts apply if a user uses the PHP user functions fopen, fread, fwrite? Since Saschas fix in PHP4 there this does not happen. What about PHP5? I would try to fix this everywhere in the future. ----- Uwe Schindler thetaphi@php.net - http://www.php.net NSAPI SAPI developer Erlangen, Germany --=====================_141000588==_ Content-Type: text/plain; name="zend_fdopen.patch.txt"; x-mac-type="42494E41"; x-mac-creator="74747874" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="zend_fdopen.patch.txt" SW5kZXg6IFplbmQvemVuZF9zdHJlYW0uYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvcmVwb3NpdG9y eS9aZW5kRW5naW5lMi96ZW5kX3N0cmVhbS5jLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjEwCmRp ZmYgLXUgLXIxLjEwIHplbmRfc3RyZWFtLmMKLS0tIFplbmQvemVuZF9zdHJlYW0uYwkxMyBNYXIg MjAwNSAxNzo0ODo0NSAtMDAwMAkxLjEwCisrKyBaZW5kL3plbmRfc3RyZWFtLmMJNyBBcHIgMjAw NSAwNzoyOTo1NCAtMDAwMApAQCAtNjAsNiArNjAsOSBAQAogCQkJCiAJCWNhc2UgWkVORF9IQU5E TEVfRkQ6CiAJCQlmaWxlX2hhbmRsZS0+aGFuZGxlLmZwID0gZmRvcGVuKGZpbGVfaGFuZGxlLT5o YW5kbGUuZmQsICJyYiIpOworCQkJaWYgKGZpbGVfaGFuZGxlLT5oYW5kbGUuZnAgPT0gTlVMTCkg eworCQkJCXJldHVybiBGQUlMVVJFOworCQkJfQogCQkJZmlsZV9oYW5kbGUtPnR5cGUgPSBaRU5E X0hBTkRMRV9GUDsKIAkJCWJyZWFrOwogCQkJCg== --=====================_141000588==_--