From 5bf6a093ad9072865c6b1b52e39144b16dfe5300 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sun, 11 May 2014 15:11:03 +0200 Subject: [PATCH 1/2] Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245) Linux apparently does not like memcpy in overlapping regions... --- Zend/zend_exceptions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index ced1ebf6397..bf90ae7be39 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -363,7 +363,7 @@ ZEND_METHOD(error_exception, getSeverity) #define TRACE_ARG_APPEND(vallen) \ *str = (char*)erealloc(*str, *len + 1 + vallen); \ - memcpy((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added); + memmove((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added); /* }}} */ From 62b2eb666d8d418e1c4672bc81d00111f18049bd Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sun, 11 May 2014 15:13:40 +0200 Subject: [PATCH 2/2] Updated NEWS --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 848029fcdc3..2c5fb894e10 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,9 @@ PHP NEWS . Fixed bug #65701 (copy() doesn't work when destination filename is created by tempnam()). (Boro Sitnikovski) . Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol) + . Fixed bug #67245 (usage of memcpy() with overlapping src and dst in + zend_exceptions.c) (backported fix from PHP 5.6; initially committed + to wrong branch). (Bob) - Date: . Fixed bug #67118 (DateTime constructor crash with invalid data). (Anatol)