From: Frank M. Kromann Date: Fri, 18 Nov 2005 19:13:35 +0000 (+0000) Subject: Fix #33153 Crash in mssql_next_result(). X-Git-Tag: RELEASE_2_0_2~179 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14889ccfbd09ed9575c48630ee4cf55dedfa9054;p=php Fix #33153 Crash in mssql_next_result(). --- diff --git a/NEWS b/NEWS index 927e4d0a19..78f6ea1cb4 100644 --- a/NEWS +++ b/NEWS @@ -26,3 +26,4 @@ PHP NEWS - Added possibility to check in which extension an internal function was defined using reflection API. (Johannes) - Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus) +- Fixed bug #33153 (crash in mssql_next result). (Frank) diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 52acd8a4f0..ea14451dea 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -1865,6 +1865,11 @@ PHP_FUNCTION(mssql_next_result) mssql_ptr = result->mssql_ptr; retvalue = dbresults(mssql_ptr->link); + + while (dbnumcols(mssql_ptr->link) <= 0 && retvalue == SUCCEED) { + retvalue = dbresults(mssql_ptr->link); + } + if (retvalue == FAIL) { RETURN_FALSE; }