From c9f4bf9fcd9201a7447dcb351c810ef7200755a8 Mon Sep 17 00:00:00 2001
From: yang-g <yangg@google.com>
Date: Thu, 13 Apr 2017 11:21:51 -0700
Subject: [PATCH] get rid of the trailing null in path

---
 src/core/lib/channel/http_client_filter.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c
index 151fb9885d..11b36146d8 100644
--- a/src/core/lib/channel/http_client_filter.c
+++ b/src/core/lib/channel/http_client_filter.c
@@ -341,11 +341,8 @@ static grpc_error *hc_mutate_op(grpc_exec_ctx *exec_ctx,
         /* remove trailing unused memory and add trailing 0 to terminate string
          */
         char *t = (char *)GRPC_SLICE_START_PTR(path_with_query_slice);
-        /* safe to use strlen since base64_encode will always add '\0' */
-        size_t path_length = strlen(t) + 1;
-        *(t + path_length) = '\0';
         path_with_query_slice =
-            grpc_slice_sub(path_with_query_slice, 0, path_length);
+            grpc_slice_sub(path_with_query_slice, 0, strlen(t));
 
         /* substitute previous path with the new path+query */
         grpc_mdelem mdelem_path_and_query = grpc_mdelem_from_slices(
-- 
GitLab