From cbd2fc2803b369bc1445cf317dc3ca50f68e15fc Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 29 Mar 2004 21:03:25 +0000 Subject: [PATCH] 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 --- src/main/http_vhost.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } } -- 2.47.2