Make sure USSD code only responds *#100# for retrieving own number
strstr() was used with wrong argument order, causing it to always match,
and causing an invalid response to a variety of different SS and USSD
requests.
This has apparently caused havoc among a number of HTC phones which
issue SS requests without user interaction upon boot, and then trip over
our inappropriate response.
diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c
index 72f26bd..76ee101 100644
--- a/openbsc/src/libmsc/ussd.c
+++ b/openbsc/src/libmsc/ussd.c
@@ -54,7 +54,7 @@
if (req.text[0] == 0xFF) /* Release-Complete */
return 0;
- if (strstr(USSD_TEXT_OWN_NUMBER, req.text) != NULL) {
+ if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.text)) {
DEBUGP(DMM, "USSD: Own number requested\n");
rc = send_own_number(conn, msg, &req);
} else {