Commit f2598194 authored by Stefan Eissing's avatar Stefan Eissing
Browse files

* mod_proxy_http2: ressurrecting some of the good parts of r1831231 and using...

 * mod_proxy_http2: ressurrecting some of the good parts of r1831231 and using memcpy instead of strncpy to make intentions more clear


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1832937 13f79535-47bb-0310-9956-ffa450edef68
parent 7bd72465
Loading
Loading
Loading
Loading
+3 −5
Changes for modules/http2/h2_proxy_util.c: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -951,9 +951,7 @@ static void map_link(link_ctx *ctx)
                          "link_reverse_map uri too long, skipped: %s", ctx->s);
            return;
        }
        strncpy(buffer + buffer_len, ctx->s + ctx->link_start, link_len);
        buffer_len += link_len;
        buffer[buffer_len] = '\0';
        apr_cpystrn(buffer + buffer_len, ctx->s + ctx->link_start, link_len + 1);
        if (!prepend_p_server
            && strcmp(ctx->real_backend_uri, ctx->p_server_uri)
            && !strncmp(buffer, ctx->real_backend_uri, ctx->rbu_len)) {
@@ -961,8 +959,8 @@ static void map_link(link_ctx *ctx)
             * to work, we need to use the proxy uri */
            int path_start = ctx->link_start + ctx->rbu_len;
            link_len -= ctx->rbu_len;
            strcpy(buffer, ctx->p_server_uri);
            strncpy(buffer + ctx->psu_len, ctx->s + path_start, link_len);
            memcpy(buffer, ctx->p_server_uri, ctx->psu_len);
            memcpy(buffer + ctx->psu_len, ctx->s + path_start, link_len);
            buffer_len = ctx->psu_len + link_len;
            buffer[buffer_len] = '\0';            
        }