aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Makarand Dharmapurikar <makarandd@google.com>2017-04-14 09:07:02 -0700
committerGravatar Makarand Dharmapurikar <makarandd@google.com>2017-04-14 09:07:02 -0700
commitd65b44a3dbb631ce313b17402725f976e47a55e3 (patch)
tree10f29fe3e0c21aa97d0263983eec4af20162f74e /src/core
parent957562780adb3f92afbaf19bf7a68f397c55b6d3 (diff)
parent63ed60f0483523522067d098abb6044ab6b99e27 (diff)
Merge branch 'caching_uri' of https://github.com/makdharma/grpc into makdharma-caching_uri
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ext/filters/http/client/http_client_filter.c4
-rw-r--r--src/core/ext/filters/http/server/http_server_filter.c6
2 files changed, 4 insertions, 6 deletions
diff --git a/src/core/ext/filters/http/client/http_client_filter.c b/src/core/ext/filters/http/client/http_client_filter.c
index 019f2ead1d..b896c7e7bb 100644
--- a/src/core/ext/filters/http/client/http_client_filter.c
+++ b/src/core/ext/filters/http/client/http_client_filter.c
@@ -334,10 +334,8 @@ static grpc_error *hc_mutate_op(grpc_exec_ctx *exec_ctx,
*/
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(
diff --git a/src/core/ext/filters/http/server/http_server_filter.c b/src/core/ext/filters/http/server/http_server_filter.c
index 952728b352..ff857878e4 100644
--- a/src/core/ext/filters/http/server/http_server_filter.c
+++ b/src/core/ext/filters/http/server/http_server_filter.c
@@ -240,9 +240,9 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
const int k_url_safe = 1;
grpc_slice_buffer_add(
&calld->read_slice_buffer,
- grpc_base64_decode(exec_ctx,
- (const char *)GRPC_SLICE_START_PTR(query_slice),
- k_url_safe));
+ grpc_base64_decode_with_len(
+ exec_ctx, (const char *)GRPC_SLICE_START_PTR(query_slice),
+ GRPC_SLICE_LENGTH(query_slice), k_url_safe));
grpc_slice_buffer_stream_init(&calld->read_stream,
&calld->read_slice_buffer, 0);
calld->seen_path_with_query = true;