aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-13 13:25:32 +0200
committerHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-13 13:25:32 +0200
commit571602f43cf59d9d46d9643319aafbf074731e64 (patch)
tree54b33ecfe9c32b57b7a33f5816abcb83f4cb9cbd /openbsc
parent336f8ec57a1f33997967b9a5d1e10ec2358ee3d6 (diff)
fix segfault in vty sms sending code
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/vty_interface.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index 25aa5f185..4933bb4e9 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -1217,11 +1217,10 @@ int sms_from_text(struct gsm_subscriber *receiver, const char *text)
if (!receiver->lac) {
/* subscriber currently not attached, store in database? */
- subscr_put(sms->receiver);
return CMD_WARNING;
}
- sms->receiver = receiver;
+ sms->receiver = subscr_get(receiver);
strncpy(sms->text, text, sizeof(sms->text)-1);
/* FIXME: don't use ID 1 static */
@@ -1245,7 +1244,7 @@ static int _send_sms_buffer(struct gsm_subscriber *receiver,
sms = sms_from_text(receiver, buffer_getstr(b));
- gsm411_send_sms_subscr(sms->receiver, sms);
+ gsm411_send_sms_subscr(receiver, sms);
return CMD_SUCCESS;
}