mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 21:47:15 +02:00
zebra: fix possible null dereference
Don't attempt to dereference `ifp` directly if it might be null: there is a check right before this usage: `ifp ? ifp->info : NULL`. In this context it should be safe to assume `ifp` is not NULL because the only caller of this function checks that for this `ifindex`. For consistency we'll check for null anyway in case this ever changes (and with this the coverity scan warning gets silenced). Found by Coverity Scan (CID 1519776) Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
69306c44e8
commit
ab80e474f2
|
@ -1436,7 +1436,8 @@ static void zebra_if_netconf_update_ctx(struct zebra_dplane_ctx *ctx,
|
||||||
if (IS_ZEBRA_DEBUG_KERNEL)
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: if %s(%u) zebra info pointer is NULL",
|
"%s: if %s(%u) zebra info pointer is NULL",
|
||||||
__func__, ifp->name, ifp->ifindex);
|
__func__, ifp ? ifp->name : "(null)",
|
||||||
|
ifp ? ifp->ifindex : ifindex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (afi == AFI_IP) {
|
if (afi == AFI_IP) {
|
||||||
|
|
Loading…
Reference in a new issue