aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-06-06 16:55:42 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-06-06 16:55:42 -0700
commit1b83d32b7daa7c16b83a61deda62ebdf706c2cfc (patch)
tree821f369811467fd9bf6584507ae1f51cea744b17 /src/core
parentf03344e73a4e0eafb969fe4675babcb50ac08ae6 (diff)
Fix fuzzer error
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/security/util/json_util.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/lib/security/util/json_util.cc b/src/core/lib/security/util/json_util.cc
index 75512a19c9..fe9f5fe3d3 100644
--- a/src/core/lib/security/util/json_util.cc
+++ b/src/core/lib/security/util/json_util.cc
@@ -29,6 +29,10 @@ const char* grpc_json_get_string_property(const grpc_json* json,
const char* prop_name) {
grpc_json* child;
for (child = json->child; child != nullptr; child = child->next) {
+ if (child->key == nullptr) {
+ gpr_log(GPR_ERROR, "Invalid (null) JSON key encountered");
+ return nullptr;
+ }
if (strcmp(child->key, prop_name) == 0) break;
}
if (child == nullptr || child->type != GRPC_JSON_STRING) {