From 8bc286285567712dc164e927980d1cf30171c558 Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Mon, 15 Jun 2009 17:06:02 +0200 Subject: [PATCH] Don't parse URL port as signed short, but to int and cast to unsigned short. Closes #3264. --- url.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.40.0