[MERGED] osmo-msc[master]: sms db: don't attempt to query pending SMS for unset MSISDN

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Dec 6 12:51:17 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: sms db: don't attempt to query pending SMS for unset MSISDN
......................................................................


sms db: don't attempt to query pending SMS for unset MSISDN

When the subscriber has no MSISDN, we might construct an invalid SQL statement
such as

  ... AND dest_addr= AND ...

Instead, don't even query for empty MSISDNs.

Related: OS#2706
Change-Id: I7d6169d774b2da04b3051957e364fe620feed51e
---
M src/libmsc/db.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/db.c b/src/libmsc/db.c
index 4e4477b..ca27b6a 100644
--- a/src/libmsc/db.c
+++ b/src/libmsc/db.c
@@ -840,6 +840,10 @@
 	if (!vsub->lu_complete)
 		return NULL;
 
+	/* A subscriber having no phone number cannot possibly receive SMS. */
+	if (*vsub->msisdn == '\0')
+		return NULL;
+
 	result = dbi_conn_queryf(conn,
 		"SELECT * FROM SMS"
 		" WHERE sent IS NULL"

-- 
To view, visit https://gerrit.osmocom.org/5183
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d6169d774b2da04b3051957e364fe620feed51e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list