]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: fix null memory access on IGMP source limit 18285/head
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 28 Feb 2025 13:40:35 +0000 (10:40 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 28 Feb 2025 14:34:36 +0000 (11:34 -0300)
When the IGMP group source limit is reached the function
`igmp_get_source_by_addr` won't return a `struct gm_source` so we must
test for that condition before attempting to access its fields.

Fixes coverity scan issue 1637406.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
pimd/pim_igmpv3.c

index 2de2b32688775b153b0659c845317e20eb692176..3cbab499dbfe95f3caca2a928523b95f4a346af0 100644 (file)
@@ -843,7 +843,7 @@ static void toex_incl(struct gm_group *group, int num_sources,
 
                /* Lookup reported source (B) */
                source = igmp_get_source_by_addr(group, *src_addr, &new);
-               if (!new) {
+               if (!new && source != NULL) {
                        /* If found, clear deletion flag: (A*B) */
                        IGMP_SOURCE_DONT_DELETE(source->source_flags);
                        /* and set SEND flag (A*B) */