diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-30 11:30:01 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-30 11:59:30 +0800 |
commit | 06abe9f3837687f3774145649922949e4ad35f95 (patch) | |
tree | aeee206c89d6620bbf34c1471f4db9c4a674f3aa /openbsc/src/ussd.c | |
parent | 66efcbce659239a9d47e893293e88a9dc7cd8251 (diff) |
ussd.c: Make sure text is memset to zero..
Make the strstr fail fast, make sure the text is null terminated...
Diffstat (limited to 'openbsc/src/ussd.c')
-rw-r--r-- | openbsc/src/ussd.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |