diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-18 06:13:19 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-18 06:14:21 +0000 |
commit | 55763d3da1c0f154b209c8c8d1ddc97b6ee0c2d7 (patch) | |
tree | 587490792388423e35b785eb73874532190fa1a7 | |
parent | 299133d7b1be6185f094d57ef5dd45f9c9febf4a (diff) | |
download | subsurface-55763d3da1c0f154b209c8c8d1ddc97b6ee0c2d7.tar.gz |
Fix crash when opening Poseidon_MkVILog.xml
In commit d5d7fdc9af98 ("For CCR dives, show plot for diluent and O2
cylinder pressures") we end up dereferencing current before it is first
initialized. Bad.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | gaspressures.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gaspressures.c b/gaspressures.c index 73010846a..58e570423 100644 --- a/gaspressures.c +++ b/gaspressures.c @@ -402,7 +402,8 @@ void populate_pressure_information(struct dive *dive, struct divecomputer *dc, s missing_pr = 1; continue; } - current->end = pressure; + if (current) + current->end = pressure; /* Was it continuous? */ if ((o2_flag) && (O2CYLINDER_PRESSURE(entry - 1))) // in the case of CCR o2 pressure |