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.
This commit is contained in:
Tobias Engel 2012-02-24 22:23:17 +01:00 committed by Harald Welte
parent 2935034b5e
commit c33d7d71cb
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg)
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 {