Hi Harald,
thanks for your bug analysis and patch. However, I
don't really see how
- if (strstr(USSD_TEXT_OWN_NUMBER,
req.text) != NULL) {
+ if (strcmp(USSD_TEXT_OWN_NUMBER, (const char *) req.text) == 0) {
will fix it. What other SS operations include a *#100# in them, so the
old code would match on them?
no, the old code matches any _substring_ of "*#100#", including the
empty string (which is the case if it was a non-USSD-SS operation).
(In strstr, a substring of the second parameter is searched for in the
first parameter.)
If it would have been
if (strstr(req.text, USSD_TEXT_OWN_NUMBER) != NULL) {
only strings that at least included "*#100#" would have been matched.
-Tobias