summaryrefslogtreecommitdiff
path: root/pimd/pim_join.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2019-11-20 13:54:36 +0200
committerGitHub <noreply@github.com>2019-11-20 13:54:36 +0200
commitd64ecad8968807fea8479b2001665de3c2b5f208 (patch)
tree213c104fa3a77c2d2c728bfbdd3745b3a316d8c7 /pimd/pim_join.c
parentc8eeee33c1f0939ea681e60827ae4623bc7fd10d (diff)
parentd83a854b5b364460cad1d271a7a771b5814466a2 (diff)
Merge pull request #5383 from donaldsharp/pim_buffer_fun
pimd: Various buffer overflow reads and crashes
Diffstat (limited to 'pimd/pim_join.c')
-rw-r--r--pimd/pim_join.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 842d6684b5..89be42842e 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -83,6 +83,11 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
&& (source_flags & PIM_WILDCARD_BIT_MASK)) {
struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
+ if (!rp) {
+ zlog_warn("%s: Lookup of RP failed for %pSG4",
+ __PRETTY_FUNCTION__, sg);
+ return;
+ }
/*
* If the RP sent in the message is not
* our RP for the group, drop the message
@@ -136,6 +141,12 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
&& (source_flags & PIM_WILDCARD_BIT_MASK)) {
struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
+ if (!rp) {
+ if (PIM_DEBUG_PIM_TRACE)
+ zlog_debug("%s: RP for %pSG4 completely failed lookup",
+ __PRETTY_FUNCTION__, sg);
+ return;
+ }
// Ignoring Prune *,G's at the moment.
if (sg->src.s_addr != rp->rpf_addr.u.prefix4.s_addr)
return;