Skip to content

Commit f78ae8d

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Fix GH-9033: Loading blacklist file can fail due to negative length
2 parents 4ad7e72 + 4834cfe commit f78ae8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)