From: Rocco Rutte Date: Mon, 15 Jun 2009 15:06:02 +0000 (+0200) Subject: Don't parse URL port as signed short, but to int and cast to unsigned short. Closes... X-Git-Tag: mutt-1-5-21-rel~245 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bc286285567712dc164e927980d1cf30171c558;p=mutt Don't parse URL port as signed short, but to int and cast to unsigned short. Closes #3264. --- diff --git a/url.c b/url.c index 58c36421..58b54326 100644 --- 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;