daniel has uploaded this change for review.
tcap_as_loadshare_vty: Avoid possible NULL pointer dereference
argv[1]/as_name is always set so the `if (as_name)` guard can be
removed. This lets Coverity verify that as is never dereferenced if
NULL.
Related: Coverity CID#551555
Change-Id: Ia9151ae63be3977c2eccf246316b99c20284dbe2
---
M src/tcap_as_loadshare_vty.c
1 file changed, 8 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/39/41539/1
diff --git a/src/tcap_as_loadshare_vty.c b/src/tcap_as_loadshare_vty.c
index dcd8ccf..e6506e8 100644
--- a/src/tcap_as_loadshare_vty.c
+++ b/src/tcap_as_loadshare_vty.c
@@ -66,12 +66,10 @@
return CMD_WARNING;
}
- if (as_name) {
- as = osmo_ss7_as_find_by_name(inst, as_name);
- if (!as) {
- vty_out(vty, "No AS %s found%s", as_name, VTY_NEWLINE);
- return CMD_WARNING;
- }
+ as = osmo_ss7_as_find_by_name(inst, as_name);
+ if (!as) {
+ vty_out(vty, "No AS %s found%s", as_name, VTY_NEWLINE);
+ return CMD_WARNING;
}
vty_out(vty, "Tid Min Tid Max SSN PC ASP Name %s", VTY_NEWLINE);
@@ -108,12 +106,10 @@
return CMD_WARNING;
}
- if (as_name) {
- as = osmo_ss7_as_find_by_name(inst, as_name);
- if (!as) {
- vty_out(vty, "No AS %s found%s", as_name, VTY_NEWLINE);
- return CMD_WARNING;
- }
+ as = osmo_ss7_as_find_by_name(inst, as_name);
+ if (!as) {
+ vty_out(vty, "No AS %s found%s", as_name, VTY_NEWLINE);
+ return CMD_WARNING;
}
vty_out(vty, "Tid Min Tid Max SSN PC ASP Name %s", VTY_NEWLINE);
To view, visit change 41539. To unsubscribe, or for help writing mail filters, visit settings.