mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
nitb: Add a missing NULL check for searching the subscriber
"subscriber " SUBSCR_TYPES " ID sms pending-send could fail with an invalid ID/IMSI for the subscriber. Fixes: Coverity CID 1040715
This commit is contained in:
@@ -216,9 +216,16 @@ DEFUN(subscriber_send_pending_sms,
|
||||
SUBSCR_HELP "SMS Operations\n" "Send pending SMS\n")
|
||||
{
|
||||
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
||||
struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]);
|
||||
struct gsm_subscriber *subscr;
|
||||
struct gsm_sms *sms;
|
||||
|
||||
subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]);
|
||||
if (!subscr) {
|
||||
vty_out(vty, "%% No subscriber found for %s %s%s",
|
||||
argv[0], argv[1], VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
sms = db_sms_get_unsent_by_subscr(gsmnet, subscr->id, UINT_MAX);
|
||||
if (sms)
|
||||
gsm411_send_sms_subscr(sms->receiver, sms);
|
||||
|
Reference in New Issue
Block a user