Skip to content

Commit fcd26ff

Browse files
committed
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. Closes GH-6024
1 parent b2a33ab commit fcd26ff

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PHP NEWS
66
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
77
(Andy Postnikov)
88

9+
- OPcache:
10+
. Fixed bug #80002 (calc free space for new interned string is wrong).
11+
(t-matsuno)
12+
913
03 Sep 2020, PHP 7.3.22
1014

1115
- Core:

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ zend_string* ZEND_FASTCALL accel_new_interned_string(zend_string *str)
487487
} while (pos != STRTAB_INVALID_POS);
488488
}
489489

490-
if (UNEXPECTED(ZCSG(interned_strings).end - ZCSG(interned_strings).top < STRTAB_STR_SIZE(str))) {
490+
if (UNEXPECTED((char*)ZCSG(interned_strings).end - (char*)ZCSG(interned_strings).top < STRTAB_STR_SIZE(str))) {
491491
/* no memory, return the same non-interned string */
492492
zend_accel_error(ACCEL_LOG_WARNING, "Interned string buffer overflow");
493493
return str;

0 commit comments

Comments
 (0)