]> git.tdb.fi Git - ext/subsurface.git/commit
Fix use of uninitialized variable if there are no samples
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 29 Oct 2011 20:24:56 +0000 (13:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 29 Oct 2011 20:24:56 +0000 (13:24 -0700)
commitb74cc4f523841729a9a7eaec3d29252e740a259d
treee4ba8801544fb9759d9dfb91e18bf4192982159f
parent28247d3baa9967fa39772c41077e714c4c533c82
Fix use of uninitialized variable if there are no samples

When creating the plot_info, the 'entry' variable pointing to the last
plot_info data was not initialized (because there was no data to fill
in), and was then incorrectly used to fill in the last tank pressure.

We also used to look at 'dive->sample[0].cylinderindex' even if no
sample[0] necessarily existed.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
profile.c