diff options
author | yang-g <yangg@google.com> | 2016-12-21 14:18:07 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2016-12-21 14:18:07 -0800 |
commit | 92fa9608f23791728dc68ff90da1be560511cc7c (patch) | |
tree | 62760980aa9cb4c54753da91900eab17cdea33dc /src/core/lib | |
parent | 659ddda0eb532b42830bdba34d6db024ad8c30e3 (diff) |
Check and fail if user provides a metadata key starting with :
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/surface/validate_metadata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/lib/surface/validate_metadata.c b/src/core/lib/surface/validate_metadata.c index 84f0a083bc..f49dd8584b 100644 --- a/src/core/lib/surface/validate_metadata.c +++ b/src/core/lib/surface/validate_metadata.c @@ -53,7 +53,7 @@ int grpc_header_key_is_legal(const char *key, size_t length) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xff, 0x03, 0x00, 0x00, 0x00, 0x80, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - if (length == 0) { + if (length == 0 || key[0] == ':') { return 0; } return conforms_to(key, length, legal_header_bits); |