]> granicus.if.org Git - mutt/commitdiff
Don't parse URL port as signed short, but to int and cast to unsigned short. Closes...
authorRocco Rutte <pdmef@gmx.net>
Mon, 15 Jun 2009 15:06:02 +0000 (17:06 +0200)
committerRocco Rutte <pdmef@gmx.net>
Mon, 15 Jun 2009 15:06:02 +0000 (17:06 +0200)
url.c

diff --git a/url.c b/url.c
index 58c3642138cbd42c1affac09cb72a42e1460f976..58b54326fdf9e8032f6b46733a276e132d53ffce 100644 (file)
--- a/url.c
+++ b/url.c
@@ -143,9 +143,11 @@ static char *ciss_parse_userhost (ciss_url_t *ciss, char *src)
   
   if ((p = strchr (t, ':')))
   {
+    int t;
     *p++ = '\0';
-    if (mutt_atos (p, (short*) &ciss->port) < 0)
+    if (mutt_atoi (p, &t) < 0 || t < 0 || t > 0xffff)
       return NULL;
+    ciss->port = (unsigned short)t;
   }
   else
     ciss->port = 0;