Blob Blame History Raw
From: Razvan Crainea <razvan@opensips.org>
Date: Mon, 18 Jan 2016 19:30:48 +0200
Subject: [PATCH] uri: fix e164_check overflow checking

Reported by @ferrored on github
Closes #762

(cherry picked from commit 70e5a656c3cd4aa14757245dd710d3869575d3ca)

diff --git a/modules/uri/checks.c b/modules/uri/checks.c
index 7fe5743..a895af6 100644
--- a/modules/uri/checks.c
+++ b/modules/uri/checks.c
@@ -351,7 +351,7 @@ static inline int e164_check(str* _user)
     char c;
 
     if ((_user->len > 2) && (_user->len < 17) && ((_user->s)[0] == '+')) {
-	for (i = 1; i <= _user->len; i++) {
+	for (i = 1; i < _user->len; i++) {
 	    c = (_user->s)[i];
 	    if (c < '0' || c > '9') return -1;
 	}