Bug #14230
open
PHP error with pfBlockerNG
Added by Marcos M over 1 year ago.
Updated about 1 year ago.
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
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
I'm not seeing any PHP errors in 3.2.0_4 of pfBlockerNG. Was there any particular steps to reproduce this problem?
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).
- Is duplicate of Bug #14554: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string added
Also available in: Atom
PDF