|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31818 crash with batches on zero row queries
Submitted: 2005-02-02 17:23 UTC Modified: 2005-02-21 19:57 UTC
From: xs0 at xs0 dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.0.3 OS: Windows Server 2003
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:
Bug Type:
From: xs0 at xs0 dot com
New email:
PHP Version: OS:


 [2005-02-02 17:23 UTC] xs0 at xs0 dot com
I executed mssql_query("...", $db, 50). The result was empty (no rows returned), and there was a read from 0x00000000 when (I think) mssql_fetch_assoc() executed. 

Reproduce code:
I had no time to record the exact code, but it was something like this:

$q=mssql_query("select * from table", $db, 50);
do {
    while ($row=mssql_fetch_assoc($q)) {
} while (mssql_fetch_batch($q)>0);

the table was empty. I then prepended

if (mssql_num_rows($q)>0)

and everything was fine.

Expected result:
nothing, the table was empty :)

Actual result:
a crash because of reading 0x00000000


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-02 17:55 UTC]
Please try using this CVS snapshot:
For Windows:
 [2005-02-21 19:57 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 15:01:28 2024 UTC