From 01455bb15bd673b81c68b6bcab8228a2a8bdff17 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Tue, 22 Jan 2019 08:47:04 -0500 Subject: [PATCH] json_config: dont dereference when no next config entry Change-Id: I83576452d9ece2445a52cb37524eab80bcb56d52 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/441570 Reviewed-by: Pawel Wodkowski Reviewed-by: Ben Walker Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- lib/event/json_config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/event/json_config.c b/lib/event/json_config.c index 44df6b4cd..f1b86a2f5 100644 --- a/lib/event/json_config.c +++ b/lib/event/json_config.c @@ -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);