Bug #67245 [NEW]: usage of memcpy() with overlapping src and dst in zend_exceptions.c

From: Date: Sun, 11 May 2014 12:27:14 +0000
Subject: Bug #67245 [NEW]: usage of memcpy() with overlapping src and dst in zend_exceptions.c
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185758@lists.php.net to get a copy of this message
From: gm dot outside+php at gmail dot com Operating system: Linux PHP version: 5.5.12 Package: *General Issues Bug Type: Bug Bug description:usage of memcpy() with overlapping src and dst in zend_exceptions.c Description: ------------ According to man page for memcpy(3) the function should not be used with overlapping source and destination arguments. A recent update to Zend/zend_exceptions.c (commit: http://git.php.net/?p=php-src.git;a=commitdiff;h=afa03a470ef90a53f2b59a8175f77afdb6b5a651) introduced formatting of trace's arguments where it uses memcpy() with overlapping addresses. This causes issues on at least systems with glibc 2.3.6 and the testsuite on such systems fails. If one replaces memcpy() with memmove() the testsuite will pass again. P.S. I believe that there should be a more efficient way to achieve the string formatting since re-allocating string byte by byte should be very inefficient, but this is unrelated to the bug at hand. -- Edit bug report at https://bugs.php.net/bug.php?id=67245&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67245&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67245&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67245&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67245&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67245&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67245&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67245&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67245&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67245&r=support Expected behavior: https://bugs.php.net/fix.php?id=67245&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67245&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67245&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67245&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67245&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67245&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67245&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67245&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67245&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67245&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67245&r=mysqlcfg

« previous php.bugs (#185758) next »