From 5ed235e71a4a88334e126c285f8e34df6ffa5096 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 25 Jul 2022 18:01:37 +0200 Subject: [PATCH 1/2] Initialize blacklist_path_length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason, GCC warns[1]: | ‘blacklist_path_length’ may be used uninitialized in this function | [-Werror=maybe-uninitialized] This looks like a false positive to me, but it doesn't hurt to explicitly initialize the variable. [1] --- ext/opcache/zend_accelerator_blacklist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 1912ba8ded0eb..c72b78ea5898b 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -241,7 +241,7 @@ static void zend_accel_blacklist_loadone(zend_blacklist *blacklist, char *filena { char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL; FILE *fp; - int path_length, blacklist_path_length; + int path_length, blacklist_path_length = NULL; if ((fp = fopen(filename, "r")) == NULL) { zend_accel_error(ACCEL_LOG_WARNING, "Cannot load blacklist file: %s\n", filename); From a0be3a221b6f5840da808d4f995e5442aaac2919 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 25 Jul 2022 18:23:41 +0200 Subject: [PATCH 2/2] oops --- ext/opcache/zend_accelerator_blacklist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index c72b78ea5898b..8ddc9298bf4d3 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -241,7 +241,7 @@ static void zend_accel_blacklist_loadone(zend_blacklist *blacklist, char *filena { char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL; FILE *fp; - int path_length, blacklist_path_length = NULL; + int path_length, blacklist_path_length = 0; if ((fp = fopen(filename, "r")) == NULL) { zend_accel_error(ACCEL_LOG_WARNING, "Cannot load blacklist file: %s\n", filename);