Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16060 invoked by uid 1010); 14 Oct 2004 17:22:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15992 invoked from network); 14 Oct 2004 17:22:51 -0000 Received: from unknown (HELO mgkyb1.nw.wakwak.com) (211.9.230.193) by pb1.pair.com with SMTP; 14 Oct 2004 17:22:51 -0000 Received: from vckyb1.nw.wakwak.com (postfix@vckyb1.nw.wakwak.com [211.9.230.144]) by mgkyb1.nw.wakwak.com (8.13.1/8.13.1/2004-08-10) with SMTP id i9EHMj54082793; Fri, 15 Oct 2004 02:22:46 +0900 (JST) (envelope-from moriyoshi@at.wakwak.com) Received: from at.wakwak.com (at.wakwak.com [211.9.230.135]) by vckyb1.nw.wakwak.com (Postfix) with ESMTP id 2B0493FE02; Fri, 15 Oct 2004 02:22:45 +0900 (JST) Received: from [192.168.0.100] (newcycle.as.wakwak.ne.jp [218.225.209.145]) by at.wakwak.com (8.13.1/8.13.1/2004-09-09) with ESMTP/inet id i9EHMhPM035433; Fri, 15 Oct 2004 02:22:43 +0900 (JST) (envelope-from moriyoshi@at.wakwak.com) In-Reply-To: <20041013135028.GA29756@deejai2.mch.fsc.net> References: <20041013135028.GA29756@deejai2.mch.fsc.net> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: <901CDEA9-1E05-11D9-B817-000A95CE0C62@at.wakwak.com> Content-Transfer-Encoding: 7bit Cc: PHP Developers Mailing List Date: Fri, 15 Oct 2004 02:22:02 +0900 To: Martin Kraemer X-Mailer: Apple Mail (2.619) Subject: Re: [PHP-DEV] [PATCH PHP_4_3] Core dumps in cyrus From: moriyoshi@at.wakwak.com (Moriyoshi Koizumi) Hi, Thank you for the patch. Cyrus extension is now in PECL (http://pecl.php.net/) and I'm the primary maintainer of it. I think the problems you pointed out were already addressed and fixed in CVS. Please check out the source at http://cvs.php.net/cvs.php/pecl/cyrus/ and send me a patch if you still think something is missing then. Regards, Moriyoshi On 2004/10/13, at 22:50, Martin Kraemer wrote: > Hi, > > In the cyrus_connect() php function, the Cyrus function > imclient_connect() is called, and its return value is checked for > 0, -1 or -2. There is a problem with that however: > > a) imclient_connect() returns in fact 0, -1, -2 OR the value of > errno (if something outside of imclient_connect()'s scope failed). > This can and will happen if you pass it a valid hostname where > no IMAP server is listening. > From the man page: > imclient_connect() > Connects the client server to the host. If successful, > it returns 0 and sets the imclient argument to a > pointer to an imclient struct. The imclient struct > represents the current connection, flags, and > callbacks. On failure, the current errno is returned if > ---------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > a system call failed, -1 is returned if the host name > was not found, and -2 is returned if the service name > was not found. > > b) conn can be uninitialized if the return value is not 0, -1 or -2, > but it WILL be used in ZEND_REGISTER_RESOURCE, and will be > dereferenced at the end of PHP_FUNCTION(cyrus_connect). > > Find a patch which tries to be more conservative about pointers, plus > it checks the errno-branch of imclient_connect()'s return. > > Martin > -- > | Fujitsu Siemens > Fon: +49-89-636-46021, FAX: +49-89-636-47655 | 81730 Munich, Germany > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php