From 28db9ede41434990a0a19ca4b96ac58af3d15460 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 15 Nov 2019 09:57:17 +0100 Subject: Don't access uninitialized deco_structure Coverty found that in the export functions, we initialize the planner deco state with NULL and then possibly later access its content. This makes sure, we don't do that. Let's see if this makes Coverty happy or I missed somehting else. Fixes CID 350736 Fixes CID 350735 Signed-off-by: Robert C. Helling --- core/profile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/profile.c b/core/profile.c index ae1bb4259..1d3453a80 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1034,8 +1034,9 @@ void calculate_deco_information(struct deco_state *ds, const struct deco_state * bool first_iteration = true; int prev_deco_time = 10000000, time_deep_ceiling = 0; - if (!in_planner()) { + if (!in_planner() || !planner_ds) { ds->deco_time = 0; + ds->first_ceiling_pressure.mbar = 0; } else { ds->deco_time = planner_ds->deco_time; ds->first_ceiling_pressure = planner_ds->first_ceiling_pressure; -- cgit v1.2.3-70-g09d2