#23402 [NEW]: mssql_bind : Unhandled exception

From: Date: Tue, 29 Apr 2003 10:38:17 +0000
Subject: #23402 [NEW]: mssql_bind : Unhandled exception
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38700@lists.php.net to get a copy of this message
From: Alla <svbevno at umailrusp dot am> Operating system: W2k PHP version: 4.3.2RC2 PHP Bug Type: MSSQL related Bug description: mssql_bind : Unhandled exception BUG: mssql_bind() causes memory access violation. The second call to mssql_bind (without mssql_init) leads to memory access violation: 'memory can not be written'. mssql_init() mssql_bind() mssql_execute() mssql_bind() // !!!!!!! CRASH !!!!!!! mssql_execute() ========================================================== LOCATION: Module : php4ts.dll, File : php_mssql.c Line : ! CRASH ! (see below) Cause : zend_hash_add(..) return NULL for the output variable 'bindp', and this is not checked in the code Possible Fix : add: if( NULL == bindp ) RETURN_FALSE; Existing code source: PHP_FUNCTION(mssql_bind) { ........ memset((void*)&bind,0,sizeof(mssql_bind)); zend_hash_add( statement->binds, Z_STRVAL_PP(param_name), Z_STRLEN_PP(param_name), &bind,sizeof(mssql_bind), (void **)&bindp ); // bindp == NULL here! bindp->zval = *var; // !!!!!! CRASH !!!!!!! zval_add_ref(var); if(.....) { ...... } RETURN_TRUE; } -- Edit bug report at http://bugs.php.net/?id=23402&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23402&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23402&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23402&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23402&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23402&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23402&r=support Expected behavior: http://bugs.php.net/fix.php?id=23402&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23402&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23402&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23402&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23402&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23402&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23402&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23402&r=gnused

« previous php.bugs (#38700) next »