From f3ad346952e90c4d5dc34b5da924f1a57deb5165 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Mon, 19 Mar 2018 16:42:56 +0300 Subject: [PATCH] gRPC: fixed parsing response headers split on CONTINUATION frames. --- src/http/modules/ngx_http_grpc_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http/modules/ngx_http_grpc_module.c b/src/http/modules/ngx_http_grpc_module.c index e39be537e..5ec45e28c 100644 --- a/src/http/modules/ngx_http_grpc_module.c +++ b/src/http/modules/ngx_http_grpc_module.c @@ -2953,7 +2953,7 @@ ngx_http_grpc_parse_fragment(ngx_http_request_t *r, ngx_http_grpc_ctx_t *ctx, ctx->name.data[ctx->name.len] = '\0'; } else { - ngx_memcpy(ctx->field_end, p, size); + ctx->field_end = ngx_cpymem(ctx->field_end, p, size); ctx->name.data[ctx->name.len] = '\0'; } @@ -3062,7 +3062,7 @@ ngx_http_grpc_parse_fragment(ngx_http_request_t *r, ngx_http_grpc_ctx_t *ctx, ctx->value.data[ctx->value.len] = '\0'; } else { - ngx_memcpy(ctx->field_end, p, size); + ctx->field_end = ngx_cpymem(ctx->field_end, p, size); ctx->value.data[ctx->value.len] = '\0'; }