The recent change to eliminate the Port directive exposed this problem.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91470
13f79535-47bb-0310-9956-
ffa450edef68
w = apr_pstrdup(p, w_);
/* apr_parse_addr_port() doesn't understand ":*" so handle that first. */
- wlen = strlen(w);
- if (wlen > 2 && w[wlen - 1] == '*' && w[wlen - 2] == ':') {
- w[wlen - 2] = '\0';
- wild_port = 1;
- }
- else {
- wild_port = 0;
+ wlen = strlen(w); /* wlen must be > 0 at this point */
+ wild_port = 0;
+ if (w[wlen - 1] == '*') {
+ if (wlen < 2) {
+ wild_port = 1;
+ }
+ else if (w[wlen - 2] == ':') {
+ w[wlen - 2] = '\0';
+ wild_port = 1;
+ }
}
rv = apr_parse_addr_port(&host, &scope_id, &port, w, p);
if (rv != APR_SUCCESS) {