From: Jim Jagielski Date: Mon, 29 Mar 2004 21:03:25 +0000 (+0000) Subject: Add in some error detection, since this is userland provided X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbd2fc2803b369bc1445cf317dc3ca50f68e15fc;p=thirdparty%2Fapache%2Fhttpd.git Add in some error detection, since this is userland provided info. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@103198 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/main/http_vhost.c b/src/main/http_vhost.c index 122a2327329..e759805dcc8 100644 --- a/src/main/http_vhost.c +++ b/src/main/http_vhost.c @@ -691,8 +691,13 @@ static void fix_hostname(request_rec *r) goto bad; else { /* a known "good" port value */ + int iport; + iport = atoi(port_str); + if (iport < 1 || iport > 65535) { + goto bad; + } r->parsed_uri.port_str = ap_pstrdup(r->pool, port_str); - r->parsed_uri.port = atoi(r->parsed_uri.port_str); + r->parsed_uri.port = iport; break; } }