Actions
Bug #2283
closedpfblocker array handling when alias table is empty
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
03/13/2012
Due date:
% Done:
0%
Estimated time:
Plus Target Version:
Affected Version:
2.0.1
Affected Plus Version:
Affected Architecture:
Description
When pfblocker is not enabled or there is nothing setup for pfblocker to do, and there are no other aliases defined in the pfSense alias table, pfblocker.inc sync_package_pfblocker logs a PHP error when trying to process the empty alias table. The "if" test at:
#update pfsense alias table
if (is_array($config['aliases']['alias'])){
$aliases=$config['aliases']['alias'];
foreach($aliases as $cbalias){
...
}
}
needs to be a block that covers both statements above, as shown.
In the existing code the if test only applies itself to the 1 line immediately following it.
Otherwise the "foreach" line logs an error because $aliases is null.
This case applies equally to 2.0.n and 2.1
A sample corrected file is attached.
Files
Actions