aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/compression
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2015-07-21 17:18:36 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2015-07-21 17:18:36 -0700
commit8ec09f6530938c6126a6579ce85ee07dbf71d785 (patch)
treefdf10c5f9c199a1b097c735adeab1b76726145d2 /src/core/compression
parent1c604fd4f54e0e5744a357818c1782ff7877844e (diff)
Added tests (and bugfix) for grpc_compression_algorithm_parse
Diffstat (limited to 'src/core/compression')
-rw-r--r--src/core/compression/algorithm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/compression/algorithm.c b/src/core/compression/algorithm.c
index 077647ebe1..dbf4721d13 100644
--- a/src/core/compression/algorithm.c
+++ b/src/core/compression/algorithm.c
@@ -41,6 +41,9 @@ int grpc_compression_algorithm_parse(const char* name, size_t name_length,
* doesn't matter, given that we are comparing against string literals, but
* because this way we needn't have "name" nil-terminated (useful for slice
* data, for example) */
+ if (name_length == 0) {
+ return 0;
+ }
if (strncmp(name, "none", name_length) == 0) {
*algorithm = GRPC_COMPRESS_NONE;
} else if (strncmp(name, "gzip", name_length) == 0) {