<p>As a matter of fact, even the current version of allowing 2 digits is probably not an e164 number. The only country code that is one digit is US/Canada with '1', but then there is no real number in their numbering plan with just a single digit after the country code.</p>

<p>The patch for the code is to a part where it checks that the length is sufficient to be sure that accessing the char at position 0 (first char) is safe and it is '+'. Because after that is a FOR loop starting at positing 1 (second char) to see if there are digits.</p>

<p>It might be useful to add min/max_length restrictions, but is more or less not related to this patch (or better said, not only related to this part). That could be an enhancement.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/594#issuecomment-216250402">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZXaB6eB1Utww6eRpTNt-3bIHYEsuks5p9gorgaJpZM4IVT5a.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/594#issuecomment-216250402"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>