php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56612 runkit_import() cannot handle files w/ two or more classes inside
Submitted: 2005-10-24 11:29 UTC Modified: 2005-10-25 19:59 UTC
From: stuart at gentoo dot org Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 4.3.9 OS: Linux
Private report: No CVE-ID: None
 [2005-10-24 11:29 UTC] stuart at gentoo dot org
Description:
------------
Hi Sara,

If runkit_import() is pointed at a PHP file that contains two or more classes, runkit_import() fails with the error "Non-class in class table!" from line 240 of runkit_import.c.  See test-3.php in the runkit-tests tarball listed below.

It looks like the problem is that you can't use zend_hash_move_backwards() safely after removing the current node in the class table.  I've made a patch [1] which does the zend_hash_move_backwards() first; it works for me so far.  I've added the patch to Gentoo's runkit packages for php4 and php5.

I haven't audited the rest of runkit for similar problems; there may be other places where the same original approach has been used.

[1] http://stu.gnqs.org/downloads/runkit-0.6-multiple-classes.patch

Reproduce code:
---------------
http://stu.gnqs.org/downloads/runkit-tests.tar.gz


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-25 19:59 UTC] pollita@php.net
This bug has been fixed in CVS.

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.

Thanks for the patch.
 [2007-09-29 09:22 UTC] fhj at gfd dot jdk
http://www.meta-fx.com
forex   ??ј?
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 08 20:01:24 2021 UTC