diff --git a/NEWS b/NEWS index 927e4d0a193..78f6ea1cb41 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 52acd8a4f00..ea14451dea5 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; }