php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31201 COM functionality broken in PHP 4.3.10
Submitted: 2004-12-20 14:47 UTC Modified: 2005-01-10 17:41 UTC
From: borbarad at gmxpro dot net Assigned:
Status: Not a bug Package: COM related
PHP Version: 4.3.10 OS: Windows 2000 Server
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: borbarad at gmxpro dot net
New email:
PHP Version: OS:

 

 [2004-12-20 14:47 UTC] borbarad at gmxpro dot net
Description:
------------
When calling new COM() in PHP 4.3.10 the call will raise an exception due to read of memory at a location too close to NULL (same memory page).

This problem occurred only in the latest PHP release. It does not apply to 4.3.9! Actually because it broke some of our scripts we recognized this as a problem.



Reproduce code:
---------------
//---------------------------------------------------
function GetDomainMachines($DomainName)
{
// Get the domain object ...
  $objDomain = new COM("WinNT://".$DomainName);
// List all objects and ...
  while($obj = $objDomain->Next())
// ... filter for computers
    if ($obj->Class == "Computer"){
      $arr[] = $obj->Name;
    }
  return $arr;
}

/* Give a valid domain name as the parameter, then call
   the function and dump the array contents */


Expected result:
----------------
It will return all machine names of domain members in the hash.

Instead of filtering for type "Computer" one may use "User" and give the local machine as the "DomainName" parameter. In this case it should even work on the local machine and will return all users of the local machine.

Actual result:
--------------
Exception (messagebox, not even as a PHP error). Find a screenshot here:

http://www.erm.tu-cottbus.de/~schneol/php/Screenshot0001.png

Note, that regardless which object you try to instantiate you'll always fail reading at 0x0000006c, not different locations in memory.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-21 02:08 UTC] wez@php.net
The 4.3 COM codebase hasn't changed in the latest release, so this sounds fishy.
Are you sure you upgraded correctly and have no stale DLLs?

If you continue to have COM related problems, we highly recommend that you upgrade to PHP 5 where the COM support has been completely rewritten.

We don't support COM in PHP 4 any longer (although you might be able to sponsor one of the developers to work on it if you're really serious).

 [2004-12-21 11:26 UTC] borbarad at gmxpro dot net
> Are you sure you upgraded correctly and have no stale DLLs?
Yes. I can rule out, that there are any older DLLs in the %PATH% which may be loaded earlier. From Apache I load the php4ts.dll giving the complete path and at command-line there's no place where such a DLL could hide.
Maybe it's the symptom of another change :-/

We are going to upgrade to PHP 5 anyway, but we'll have to review all our scripts. Therefore we are still using 4.3.10.
 [2004-12-22 13:11 UTC] kir at post dot kg
I have installed CVS snapshot.
Same result.
 [2004-12-22 14:55 UTC] borbarad at gmxpro dot net
I can also confirm, the bug is still persistent.

Have only tried on command-line though, because I cannot afford downtime for our server.
 [2004-12-23 02:42 UTC] edink@php.net
Dupe of #31159
 [2005-01-10 17:41 UTC] borbarad at gmxpro dot net
Problem seems to be solved in the current stable CVS snapshot.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 06:03:45 2022 UTC