Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions mod_http2/h2_proxy_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,8 @@ static void map_link(link_ctx *ctx)
apr_cpystrn(buffer, ctx->p_server_uri, sizeof(buffer));
buffer_len = ctx->psu_len;
}
if (need_len > sizeof(buffer)) {
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, ctx->r, APLOGNO(03482)
"link_reverse_map uri too long, skipped: %s", ctx->s);
return;
}
if (need_len > sizeof(buffer))
goto out;
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)
Expand All @@ -979,6 +976,9 @@ 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;
need_len = ctx->psu_len + link_len;
if (need_len > sizeof(buffer))
goto out;
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;
Expand All @@ -999,6 +999,11 @@ static void map_link(link_ctx *ctx)
}
subst_str(ctx, ctx->link_start, ctx->link_end, mapped);
}
out:
if (need_len > sizeof(buffer)) {
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, ctx->r, APLOGNO(03482)
"link_reverse_map uri too long, skipped: %s", ctx->s);
}
}
}

Expand Down
Loading