View | Details | Raw Unified | Return to bug 52178
Collapse All | Expand All

(-)server/core.c (-2 / +11 lines)
Lines 2345-2351 Link Here
2345
static const char *server_hostname_port(cmd_parms *cmd, void *dummy, const char *arg)
2345
static const char *server_hostname_port(cmd_parms *cmd, void *dummy, const char *arg)
2346
{
2346
{
2347
    const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
2347
    const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
2348
    const char *portstr, *part;
2348
    const char *portstr, *part, *ipv6hostend;
2349
    char *scheme;
2349
    char *scheme;
2350
    int port;
2350
    int port;
2351
2351
Lines 2364-2373 Link Here
2364
      part = arg;
2364
      part = arg;
2365
    }
2365
    }
2366
2366
2367
    portstr = ap_strchr_c(part, ':');
2367
    ipv6hostend = ap_strchr_c(part, ']');
2368
    if (ipv6hostend != NULL ) {
2369
      portstr = ap_strchr_c(ipv6hostend, ':');
2370
    } else {
2371
      portstr = ap_strchr_c(part, ':');
2372
    }
2368
    if (portstr) {
2373
    if (portstr) {
2369
        cmd->server->server_hostname = apr_pstrmemdup(cmd->pool, part,
2374
        cmd->server->server_hostname = apr_pstrmemdup(cmd->pool, part,
2370
                                                      portstr - part);
2375
                                                      portstr - part);
2376
        if ((ipv6hostend != NULL ) && (part[0] == '[')) {
2377
            cmd->server->server_hostname = apr_pstrmemdup(cmd->pool, part + 1,
2378
                                                      ipv6hostend - part - 1);
2379
        }
2371
        portstr++;
2380
        portstr++;
2372
        port = atoi(portstr);
2381
        port = atoi(portstr);
2373
        if (port <= 0 || port >= 65536) { /* 65536 == 1<<16 */
2382
        if (port <= 0 || port >= 65536) { /* 65536 == 1<<16 */

Return to bug 52178