php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17714 Crash when accessing array from mssql_fetch_array()
Submitted: 2002-06-11 17:23 UTC Modified: 2002-06-12 10:01 UTC
From: curtis at csummers dot org Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.2.1 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: curtis at csummers dot org
New email:
PHP Version: OS:

 

 [2002-06-11 17:23 UTC] curtis at csummers dot org
PHP is crashing with the following error:

The instruction at "0x77fcb03d" referenced memory at "0x00000000".  The memory could not be written.

The error occurs when I am accessing data from an array returned from mssql_fetch_array().

Sample code:

while($objArr = mssql_fetch_array($objRS))
{
print('This one works:'.nl2br(stripslashes($objArr['field1'])).'<br>');
print('Crashes here (sometimes):<br>'.nl2br(stripslashes($objArr['field2'])).'<br>');
}

The crash does not always occur. I believe it may depend on the data, but I can't find any correlation between the data in the database and when it crashes.

I cannot generate this crash on 4.1.x, but I can with 4.2.0 and 4.2.1.

Here's the point at which it crashes in the php4ts.dll:

-> 1008D772   jmp         1008D781

which jumps to this line:
1008D781   mov         esi,eax

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-11 17:27 UTC] curtis at csummers dot org
--
 [2002-06-11 17:30 UTC] curtis at csummers dot org
--
 [2002-06-11 17:40 UTC] curtis at csummers dot org
Additionally, I DO NOT have magic quotes turned on, so I don't think that is the problem (see BUG #17497).
 [2002-06-11 18:37 UTC] sniper@php.net
Please shorten your example to bare minimum which still
crashes and make it complete script.. And also try the latest (NON-stable!) snapshot from http://snaps.php.net/ 

With that script the bug _might_ be in nl2br() / stripslashes() / mssql_fetch_array()..



 [2002-06-12 09:59 UTC] curtis at csummers dot org
The latest STABLE (4.2.2-dev) snapshot took care of my problem. Thanks.
 [2002-06-12 10:01 UTC] sniper@php.net
Closed then..

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Nov 28 02:05:53 2022 UTC