From 82b86fe924ed11969a7653641fdbd32ac27dc538 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 11 Dec 2013 00:53:37 +0100 Subject: [PATCH] Fix potential null pointer dereference If createTemporaryPlan was called on a empty diveplan. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index dedbd617d..fe7a7d1e3 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1422,6 +1422,8 @@ void DivePlannerPointsModel::createTemporaryPlan() lastIndex = i; plan_add_segment(&diveplan, deltaT, p.depth, p.o2, p.he, p.po2); } + if (!diveplan.dp) + return; char *cache = NULL; tempDive = NULL; const char *errorString = NULL;