Skip to content

Commit

Permalink
Avoid using uninitialized array offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
kouril committed Sep 5, 2019
1 parent 03fe9b4 commit 3cda491
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/managers/VulnerabilitiesManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ private function dpkgvercmp_in($a, $b)
$first_diff = 0;

while (($i < $l && !ctype_digit($a[$i])) || ($j < $k && !ctype_digit($b[$j]))) {
$vc = $this->order($a[$i]);
$rc = $this->order($b[$j]);
$vc = ($i < $l) ? $this->order($a[$i]) : 0;
$rc = ($j < $k) ? $this->order($b[$j]) : 0;
if ($vc != $rc) {
return $vc - $rc;
}
Expand Down Expand Up @@ -186,9 +186,6 @@ private function dpkgvercmp_in($a, $b)
*/
private function order($val)
{
if ($val == '') {
return 0;
}
if ($val == '~') {
return -1;
}
Expand Down

0 comments on commit 3cda491

Please sign in to comment.