Actions
Bug #12749
closedUninitialized array in ``array_remove_duplicates()``
Start date:
Due date:
% Done:
100%
Estimated time:
Plus Target Version:
22.05
Release Notes:
Default
Affected Version:
2.5.2
Affected Architecture:
Description
https://github.com/pfsense/pfsense/blob/master/src/etc/inc/util.inc#L3322-L3333:
function array_remove_duplicate($array, $field) {
foreach ($array as $sub) {
if (isset($sub[$field])) {
$cmp[] = $sub[$field];
}
}
$unique = array_unique(array_reverse($cmp, true));
foreach ($unique as $k => $rien) {
$new[] = $array[$k];
}
return $new;
}
$cmp
is not initialized with an empty array, and if all conditions are failed, $cmp
== null
Actions