diff options
author | Noah Eisen <ncteisen@gmail.com> | 2017-11-08 11:40:27 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-08 11:40:27 -0800 |
commit | a5ad92dd88de81f0a15afa63c1cffbaf88b4f0af (patch) | |
tree | af73ad872445fa868e349e2321e41bdf2ee9a078 | |
parent | e85fc238a0c8994651fb864cd9fe409ba68d232e (diff) | |
parent | 5dd0d6fadb20f297ec04753a19f1e2a2fd03735d (diff) |
Merge pull request #13303 from ncteisen/ubsan
Fix internal UBSAN failure
-rw-r--r-- | src/core/ext/filters/client_channel/uri_parser.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/ext/filters/client_channel/uri_parser.cc b/src/core/ext/filters/client_channel/uri_parser.cc index 917e65342b..1cc52dec12 100644 --- a/src/core/ext/filters/client_channel/uri_parser.cc +++ b/src/core/ext/filters/client_channel/uri_parser.cc @@ -59,7 +59,9 @@ static grpc_uri* bad_uri(const char* uri_text, size_t pos, const char* section, static char* decode_and_copy_component(grpc_exec_ctx* exec_ctx, const char* src, size_t begin, size_t end) { grpc_slice component = - grpc_slice_from_copied_buffer(src + begin, end - begin); + (begin == NOT_SET || end == NOT_SET) + ? grpc_empty_slice() + : grpc_slice_from_copied_buffer(src + begin, end - begin); grpc_slice decoded_component = grpc_permissive_percent_decode_slice(component); char* out = grpc_dump_slice(decoded_component, GPR_DUMP_ASCII); |