Remove patch-Zend_zend_alloc_c. The concept was removed in PHP7 and the

code it applies to was never enabled.

OK sthen@
This commit is contained in:
martijn
2018-05-28 06:15:15 +00:00
parent 8b6114ba43
commit 272dc19e81
@@ -1,26 +0,0 @@
$OpenBSD: patch-Zend_zend_alloc_c,v 1.1 2016/02/06 23:30:25 sthen Exp $
Apparently not enabled by default, and currently a bit close to release to
try doing so, but for something in #ifdef MM_HEAP_PROTECTION, you want more
than rand()^getpid() when /dev/urandom is inaccessible, right?
--- Zend/zend_alloc.c.orig.port Mon Feb 1 23:04:02 2016
+++ Zend/zend_alloc.c Mon Feb 1 23:34:27 2016
@@ -976,6 +976,9 @@ static void zend_mm_free_cache(zend_mm_heap *heap)
#if ZEND_MM_HEAP_PROTECTION || ZEND_MM_COOKIES
static void zend_mm_random(unsigned char *buf, size_t size) /* {{{ */
{
+#if defined(__OpenBSD__)
+ arc4random_buf(buf, size);
+#else
size_t i = 0;
unsigned char t;
@@ -1031,6 +1034,7 @@ static void zend_mm_random(unsigned char *buf, size_t
} while (buf[i] == 0);
t = buf[i++] << 1;
}
+#endif /* openbsd */
}
/* }}} */
#endif