Commit 4ef0a966 authored by Kazuki Yamaguchi's avatar Kazuki Yamaguchi Committed by Ondrej Zajicek (work)
Browse files

Filter: Fix comparison of BGP path mask

Add a missing return statement. Path masks with the same length were all
considered the same. Comparing two with different length would cause
out-of-bounds memory access.
parent 82937b46
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ static int
pm_same(const struct f_path_mask *m1, const struct f_path_mask *m2)
{
  if (m1->len != m2->len)
    return 0;

  for (uint i=0; i<m1->len; i++)
    if (!pmi_same(&(m1->item[i]), &(m2->item[i])))