Skip to content

Commit 4834cfe

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix GH-9033: Loading blacklist file can fail due to negative length
2 parents d50875c + 35fd97c commit 4834cfe

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ PHP NEWS
1919
. Fixed bug GH-9008 (mb_detect_encoding(): wrong results with null $encodings).
2020
(cmb)
2121

22+
- OPcache:
23+
. Fixed bug GH-9033 (Loading blacklist file can fail due to negative length).
24+
(cmb)
25+
2226
04 Aug 2022, PHP 8.1.9
2327

2428
- CLI:

ext/opcache/zend_accelerator_blacklist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@ static void zend_accel_blacklist_loadone(zend_blacklist *blacklist, char *filena
276276
}
277277

278278
/* strip \" */
279-
if (pbuf[0] == '\"' && pbuf[path_length - 1]== '\"') {
279+
if (path_length > 0 && pbuf[0] == '\"' && pbuf[path_length - 1]== '\"') {
280280
*pbuf++ = 0;
281281
path_length -= 2;
282282
}
283283

284-
if (path_length == 0) {
284+
if (path_length <= 0) {
285285
continue;
286286
}
287287

0 commit comments

Comments
 (0)