json_config: dont dereference when no next config entry

Change-Id: I83576452d9ece2445a52cb37524eab80bcb56d52
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/441570
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2019-01-22 08:47:04 -05:00 committed by Jim Harris
parent a96748a782
commit 01455bb15b

View File

@ -337,6 +337,7 @@ spdk_app_json_config_load_subsystem_config_entry(void *_ctx)
if (spdk_json_decode_object(ctx->config_it, jsonrpc_cmd_decoders,
SPDK_COUNTOF(jsonrpc_cmd_decoders), &cfg)) {
params_end = spdk_json_next(ctx->config_it);
assert(params_end != NULL);
params_len = params_end->start - ctx->config->start + 1;
SPDK_ERRLOG("Failed to decode config entry: %*s!\n", (int)params_len, (char *)ctx->config_it);
spdk_app_json_config_load_done(ctx, -EINVAL);