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
Updated by Viktor Gurov almost 3 years ago
Updated by Jim Pingle almost 3 years ago
- Status changed from New to Pull Request Review
- Assignee set to Viktor Gurov
- Target version set to 2.7.0
- Plus Target Version set to 22.05
Updated by Viktor Gurov almost 3 years ago
- Status changed from Pull Request Review to Feedback
- % Done changed from 0 to 100
Applied in changeset 5e53a7b57d1dfb4da98b1119dd2dd2eda50f2587.
Updated by Jim Pingle over 2 years ago
- Subject changed from Uninitialized array in array_remove_duplicates() to Uninitialized array in ``array_remove_duplicates()``
Updating subject for release notes.
Actions