pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38438?usp=email )


Change subject: osmo_ss7_route_destroy(): Fix potential null ptr deref
......................................................................

osmo_ss7_route_destroy(): Fix potential null ptr deref

rt ptr was being dereferenced already before checking for null.

Related: Coverity CID#425367
Change-Id: Idf7613e174e564fb388cd82dca897ff13001217b
---
M src/osmo_ss7.c
1 file changed, 3 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran 
refs/changes/38/38438/1

diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index bcbe76c..93bcfc2 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -908,17 +908,16 @@
 /*! \brief Destroy a given SS7 route */
 void osmo_ss7_route_destroy(struct osmo_ss7_route *rt)
 {
-       struct osmo_ss7_route_table *rtbl = rt->rtable;
-
        OSMO_ASSERT(ss7_initialized);

        if (!rt)
                return;

        if (ss7_route_inserted(rt)) {
-               LOGSS7(rtbl->inst, LOGL_INFO,
+               struct osmo_ss7_instance *inst = rt->rtable->inst;
+               LOGSS7(inst, LOGL_INFO,
                        "Destroying route: pc=%u=%s mask=0x%x via linkset/ASP 
'%s'\n",
-                       rt->cfg.pc, osmo_ss7_pointcode_print(rtbl->inst, 
rt->cfg.pc),
+                       rt->cfg.pc, osmo_ss7_pointcode_print(inst, rt->cfg.pc),
                        rt->cfg.mask, rt->cfg.linkset_name);
                llist_del(&rt->list);
        }

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38438?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Idf7613e174e564fb388cd82dca897ff13001217b
Gerrit-Change-Number: 38438
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to