From 9f4c694341d415b7ee28f700112119e6a19f45dd Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 20 Aug 2020 11:20:03 +0200 Subject: [PATCH] Fix #80002: calc free space for new interned string is wrong We need to calculate the free size in bytes. Patch contributed by t-matsuno. --- ext/opcache/ZendAccelerator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 80f94eaf28f2a..dd4808bb17f70 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -487,7 +487,7 @@ zend_string* ZEND_FASTCALL accel_new_interned_string(zend_string *str) } while (pos != STRTAB_INVALID_POS); } - if (UNEXPECTED(ZCSG(interned_strings).end - ZCSG(interned_strings).top < STRTAB_STR_SIZE(str))) { + if (UNEXPECTED((char*)ZCSG(interned_strings).end - (char*)ZCSG(interned_strings).top < STRTAB_STR_SIZE(str))) { /* no memory, return the same non-interned string */ zend_accel_error(ACCEL_LOG_WARNING, "Interned string buffer overflow"); return str;