From 06abe9f3837687f3774145649922949e4ad35f95 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 30 Jun 2010 11:30:01 +0800 Subject: ussd.c: Make sure text is memset to zero.. Make the strstr fail fast, make sure the text is null terminated... --- openbsc/src/ussd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsc/src/ussd.c') diff --git a/openbsc/src/ussd.c b/openbsc/src/ussd.c index 7f1489915..692df5bae 100644 --- a/openbsc/src/ussd.c +++ b/openbsc/src/ussd.c @@ -44,9 +44,11 @@ static int send_own_number(struct gsm_subscriber_connection *conn, const struct /* Entrypoint - handler function common to all mobile-originated USSDs */ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) { + int rc; struct ussd_request req; - gsm0480_decode_ussd_request(msg, &req); + memset(&req, 0, sizeof(req)); + rc = gsm0480_decode_ussd_request(msg, &req); if (req.text[0] == 0xFF) /* Release-Complete */ return 0; -- cgit v1.2.3