From 4ef0a966392672d04a567c25758462fe3bbb0fb4 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Sun, 28 Jun 2020 15:33:26 +0200 Subject: [PATCH] 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. --- filter/data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/filter/data.c b/filter/data.c index 40220255..9547a4c8 100644 --- a/filter/data.c +++ b/filter/data.c @@ -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; ilen; i++) if (!pmi_same(&(m1->item[i]), &(m2->item[i])))