Skip to content

Commit

Permalink
siputils: fix for e164_check()
Browse files Browse the repository at this point in the history
- the condition for non-digit matching was always false

(cherry picked from commit fbcfa19)
  • Loading branch information
miconda committed Jan 8, 2015
1 parent df180f1 commit 2d1032b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions modules/siputils/checks.c
Expand Up @@ -419,17 +419,17 @@ int tel2sip(struct sip_msg* _msg, char* _uri, char* _hostpart, char* _res)
*/
static inline int e164_check(str* _user)
{
int i;
char c;

if ((_user->len > 2) && (_user->len < 17) && ((_user->s)[0] == '+')) {
for (i = 1; i <= _user->len; i++) {
c = (_user->s)[i];
if (c < '0' && c > '9') return -1;
int i;
char c;

if ((_user->len > 2) && (_user->len < 17) && ((_user->s)[0] == '+')) {
for (i = 1; i <= _user->len; i++) {
c = (_user->s)[i];
if (c < '0' || c > '9') return -1;
}
return 1;
}
return 1;
}
return -1;
return -1;
}


Expand Down

0 comments on commit 2d1032b

Please sign in to comment.