From: margus at zone dot ee Operating system: CentOS 4.7/x86_64 PHP version: 5.3.0 PHP Bug Type: Reproducible crash Bug description: mysql_fetch_assoc segfaults on second parameter
Description: ------------ mysql_fetch_assoc/mysql_fetch_array will segfault PHP if second parameter (MYSQL_BOTH, MYSQL_ASSOC or MYSQL_NUM) is specified. The value of parameter does'nt make any difference. This happens only for PHP-CGI and Apache module and strangely not to CLI. Reproduce code: --------------- <?php mysql_connect ("localhost", "user", "password"); mysql_select_db ("test"); $r = mysql_query ("SELECT * FROM users"); print_r (mysql_fetch_assoc ($r, MYSQL_BOTH)); ?> Expected result: ---------------- Array ( [id] => 1 [username] => asd1 [email] => asd2 [asd] => 2000 ) Actual result: -------------- Segmentation fault -- Edit bug report at http://bugs.php.net/?id=48821&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48821&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48821&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48821&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48821&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48821&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48821&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48821&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48821&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48821&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48821&r=support Expected behavior: http://bugs.php.net/fix.php?id=48821&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48821&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48821&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48821&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48821&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48821&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48821&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48821&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48821&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48821&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48821&r=mysqlcfg