Actions
Bug #14230
openPHP error with pfBlockerNG
Status:
New
Priority:
Normal
Assignee:
-
Category:
pfBlockerNG
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Plus Target Version:
Affected Version:
2.7.0
Affected Plus Version:
23.01
Affected Architecture:
All
Description
On pfBlockerNG-3.2.0_3 and pfSense-23.01.
[02-Apr-2023 00:38:16 America/Chicago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/pfblockerng/pfblockerng.inc:5309
Stack trace:
#0 /usr/local/pkg/pfblockerng/pfblockerng.inc(5533): pfb_collect_localhosts()
#1 /usr/local/pkg/pfblockerng/pfblockerng.inc(1030): pfb_daemon_filterlog()
#2 {main}
thrown in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 5309
Relevant config attached.
Files
Related issues
Updated by Marcos M over 2 years ago
As a workaround, use the System Patches package to apply the following patch (set Path Strip Count to 0).
--- /usr/local/pkg/pfblockerng/pfblockerng.inc
+++ /usr/local/pkg/pfblockerng/pfblockerng.inc
@@ -5307,7 +5307,7 @@ function pfb_collect_localhosts() {
// Collect static DHCP hostnames/IPs
foreach (config_get_path('dhcpd', []) as $dhcp) {
- if (is_array($dhcp['staticmap'])) {
+ if (is_array($dhcp) && is_array($dhcp['staticmap'])) {
foreach ($dhcp['staticmap'] as $smap) {
$local_hosts[$smap['ipaddr']] = strtolower("{$smap['hostname']}");
}
@@ -5316,7 +5316,7 @@ function pfb_collect_localhosts() {
// Collect static DHCPv6 hostnames/IPs
foreach (config_get_path('dhcpdv6', []) as $dhcpv6) {
- if (is_array($dhcpv6['staticmap'])) {
+ if (is_array($dhcpv6) && is_array($dhcpv6['staticmap'])) {
foreach ($dhcpv6['staticmap'] as $smap) {
$local_hosts[$smap['ipaddrv6']] = strtolower("{$smap['hostname']}");
}
https://docs.netgate.com/pfsense/en/latest/development/system-patches.html
Updated by Kris Phillips over 2 years ago
I'm not seeing any PHP errors in 3.2.0_4 of pfBlockerNG. Was there any particular steps to reproduce this problem?
Updated by Andre Brait about 2 years ago
Kris Phillips wrote in #note-2:
I'm not seeing any PHP errors in 3.2.0_4 of pfBlockerNG. Was there any particular steps to reproduce this problem?
I think it only happens when upgrading pfSense from the 2.6.0 line (and corresponding Plus) to 2.7.0 (and corresponding Plus).
Updated by Andre Brait about 2 years ago
Pull request sent: https://github.com/pfsense/FreeBSD-ports/pull/1305
Updated by Marcos M about 2 years ago
- Is duplicate of Bug #14554: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string added
Actions