aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-14 08:50:57 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-14 09:04:50 +0200
commitae9d8d3131effe1243ed38f729440b8c0adcc808 (patch)
tree7aff2b111f3f23d1272142d7b9dcb094eeaf1008
parentc9251fa8c9e3bc6ea2ea9182e0f1b13b16f065ca (diff)
smpp: Checking an array for NULL will always be false
The if (submit->short_message) and if (smsc->system_id) will always be true. Fixes: Coverity CID 1042371, CID 1042372
-rw-r--r--openbsc/src/libmsc/smpp_openbsc.c2
-rw-r--r--openbsc/src/libmsc/smpp_vty.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index 1cbc4b076..e41d37776 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -113,7 +113,7 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
}
sms_msg = t->value.octet;
sms_msg_len = t->length;
- } else if (submit->short_message && submit->sm_length) {
+ } else if (submit->sm_length) {
sms_msg = submit->short_message;
sms_msg_len = submit->sm_length;
} else {
diff --git a/openbsc/src/libmsc/smpp_vty.c b/openbsc/src/libmsc/smpp_vty.c
index a2270e62a..c412bb320 100644
--- a/openbsc/src/libmsc/smpp_vty.c
+++ b/openbsc/src/libmsc/smpp_vty.c
@@ -119,7 +119,7 @@ static int config_write_smpp(struct vty *vty)
vty_out(vty, "smpp%s", VTY_NEWLINE);
vty_out(vty, " local-tcp-port %u%s", smsc->listen_port, VTY_NEWLINE);
- if (smsc->system_id && strlen(smsc->system_id) > 0)
+ if (strlen(smsc->system_id) > 0)
vty_out(vty, " system-id %s%s", smsc->system_id, VTY_NEWLINE);
vty_out(vty, " policy %s%s",
smsc->accept_all ? "accept-all" : "closed", VTY_NEWLINE);