Skip to content
Snippets Groups Projects
Commit 9f99c303 authored by Craig Tiller's avatar Craig Tiller
Browse files

Handle 0-length

parent ca3b32f6
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,7 @@ grpc_slice grpc_slice_new_with_len(void *p, size_t len,
}
grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t length) {
if (length == 0) return grpc_empty_slice();
grpc_slice slice = grpc_slice_malloc(length);
memcpy(GRPC_SLICE_START_PTR(slice), source, length);
return slice;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment