diff options
author | Craig Tiller <ctiller@google.com> | 2016-12-08 16:46:18 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-12-08 16:46:18 -0800 |
commit | 3ba16e4f0562e32cfffb786c1d74e8e49bb5e6de (patch) | |
tree | ca1f69adce74bd3cb6438d5787d59c4de535c048 /src/core/lib/slice | |
parent | b8be7a5fa7c4a2e7e7b2a454c5f04e6680492f0e (diff) |
Fix bug whereby errors on a call do not lead to cancellation
Diffstat (limited to 'src/core/lib/slice')
-rw-r--r-- | src/core/lib/slice/slice.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/lib/slice/slice.c b/src/core/lib/slice/slice.c index f0ad9f4881..e77be6fc14 100644 --- a/src/core/lib/slice/slice.c +++ b/src/core/lib/slice/slice.c @@ -436,6 +436,8 @@ int grpc_slice_slice(grpc_slice haystack, grpc_slice needle) { if (haystack_len == 0 || needle_len == 0) return -1; if (haystack_len < needle_len) return -1; + if (haystack_len == needle_len) + return grpc_slice_eq(haystack, needle) ? 0 : -1; if (needle_len == 1) return grpc_slice_chr(haystack, (char)*needle_bytes); const uint8_t *last = haystack_bytes + haystack_len - needle_len; |