diff options
author | Anton Lundin <glance@acc.umu.se> | 2013-12-11 00:53:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-11 03:13:30 +0100 |
commit | 82b86fe924ed11969a7653641fdbd32ac27dc538 (patch) | |
tree | 0aa16f980c917886103539f0e3583c8a449b3666 /qt-ui/diveplanner.cpp | |
parent | 0812d2def2a8d2bcd0bf7b2646dade989d63ae44 (diff) | |
download | subsurface-82b86fe924ed11969a7653641fdbd32ac27dc538.tar.gz |
Fix potential null pointer dereference
If createTemporaryPlan was called on a empty diveplan.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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; |