php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59277 Calling event_del cause segfault under 5.2.x and libevent 1.4.11-stable1
Submitted: 2010-06-21 22:34 UTC Modified: 2010-06-22 04:01 UTC
From: b at turbulent dot ca Assigned:
Status: Closed Package: libevent (PECL)
PHP Version: 5.2.10 OS: ubuntu karmic
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: b at turbulent dot ca
New email:
PHP Version: OS:

 

 [2010-06-21 22:34 UTC] b at turbulent dot ca
Description:
------------
Simply moving the ZVAL_TO_EVENT conversion before the base 
check in the code will fix the issue.

Enclosed patch:


--- libevent.c.orig	2010-06-22 02:31:54.000000000 +0000
+++ libevent.c	2010-06-22 02:32:12.000000000 +0000
@@ -657,12 +657,13 @@
 		return;
 	}
 
+	ZVAL_TO_EVENT(zevent, event);
+
 	if (!event->base) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to delete event without an event base");
 		RETURN_FALSE;
 	}
 
-	ZVAL_TO_EVENT(zevent, event);
 	if (event_del(event->event) == 0) {
 		RETURN_TRUE;
 	}


Reproduce code:
---------------
Not required, patch included.

Expected result:
----------------
Not required, patch included.

Actual result:
--------------
Not required, patch included.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-22 04:01 UTC] tony at daylessday dot org
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Yes, thanks, I've fixed that in SVN 3 weeks ago.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC