]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter: Fix comparison of BGP path mask
authorKazuki Yamaguchi <k@rhe.jp>
Sun, 28 Jun 2020 13:33:26 +0000 (15:33 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 28 Jun 2020 13:33:26 +0000 (15:33 +0200)
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.

filter/data.c

index 402202554c2f73ed4b345ce67e65b270026eb298..9547a4c848338bb14d83a8e6516e50895bed5517 100644 (file)
@@ -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])))