From 2bbc95e8f1e0a35a51b9657c7925f0fc68ce880d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 13 Aug 2024 22:50:11 +0200 Subject: [PATCH] planner: check nextdp for null As correctly noted by Coverity, we check nextdp for null and later dereference it. Signed-off-by: Berthold Stoeger --- core/plannernotes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/plannernotes.cpp b/core/plannernotes.cpp index 499aec2f3..270cca019 100644 --- a/core/plannernotes.cpp +++ b/core/plannernotes.cpp @@ -219,7 +219,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d continue; /* Store pointer to last entered datapoint for minimum gas calculation */ - if (dp->entered && !nextdp->entered) + if (dp->entered && nextdp && !nextdp->entered) lastbottomdp = dp; if (plan_verbatim) {