From 1b83d32b7daa7c16b83a61deda62ebdf706c2cfc Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 6 Jun 2018 16:55:42 -0700 Subject: [PATCH] Fix fuzzer error --- src/core/lib/security/util/json_util.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/lib/security/util/json_util.cc b/src/core/lib/security/util/json_util.cc index 75512a19c9b..fe9f5fe3d35 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) {