From: sixd Operating system: all PHP version: 6SVN-2010-04-29 (SVN) Package: OCI8 related Bug Type: Bug Bug description:Unnecessary realloc causes crash with "interned" strings
Description: ------------ These OCI8 tests are crashing after the implementation of "interned string" in the PHP trunk code: bind_char_1.phpt bind_char_2.phpt bind_char_3.phpt bind_char_4.phpt bind_rowid.phpt error_bind.phpt This is due to a realloc in php_oci_bind_post_exec() to add a null terminator for bound data. The crash happens on IN binds that are interned since realloc is not permitted for interned strings. Because string IN binds are always null terminated the realloc is unnecessary. Null strings are apparently not interned so modification of their zval to force an empty string is OK. String OUT binds have new memory allocated in php_oci_bind_callback() and are not interned so they can be realloced. Also all current test cases already get null terminated output from Oracle. -- Edit bug report at http://bugs.php.net/bug.php?id=51691&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51691&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51691&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51691&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51691&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51691&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51691&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51691&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51691&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51691&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51691&r=support Expected behavior: http://bugs.php.net/fix.php?id=51691&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51691&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51691&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51691&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51691&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51691&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51691&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51691&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51691&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51691&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51691&r=mysqlcfg