Discussion:
Planner: Bug in PR by bstoeger
Willem Ferguson
2018-05-18 08:30:28 UTC
Permalink
Hallo Berthold,

On March 14th you introduced a PR entitled Cleanup: fix "unsave"
snprintf()s in plannernotes.c
<https://github.com/Subsurface-divelog/subsurface/commit/a4834e198d55d50a44d6f80e2137777b64652ce7#diff-0df10959bbcbe5342528360ce6f541a5>
for Subsurface.

This PR affected the function  add_icd_entry() in plannernotes.c. The
changes, unfortunately, introduced a bug in the display of the icd data
for a dive. I include a sample dive plan so that you can see the effect
of this change in code. Activate the display of icd data in Preferences,
open the attached dive plan and edit the dive plan within the planner.
You will see random information being added to the icd data. In fact the
icd data are quite messed up because the table should include two lines
of gas change information. At least part of the problem lies in lines
55-68 of plannernotes.c.

I spent a bit of time trying to track down the problem, but it appears
to be a pointer that writes to a buffer where it should not write to.

Would you be prepared at all to look at this issue?

Kind regards,

willem
--
This message and attachments are subject to a disclaimer.

Please refer to 
http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf
<http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf> for
full
details.
Willem Ferguson
2018-05-18 10:29:11 UTC
Permalink
Hi Willem,
Post by Willem Ferguson
On March 14th you introduced a PR entitled Cleanup: fix "unsave"
snprintf()s in plannernotes.c
<https://github.com/Subsurface-divelog/subsurface/commit/a4834e198d55d50a44d
6f80e2137777b64652ce7#diff-0df10959bbcbe5342528360ce6f541a5> for Subsurface.
This PR affected the function add_icd_entry() in plannernotes.c. The
changes, unfortunately, introduced a bug in the display of the icd data
for a dive. I include a sample dive plan so that you can see the effect
of this change in code. Activate the display of icd data in Preferences,
open the attached dive plan and edit the dive plan within the planner.
You will see random information being added to the icd data. In fact the
icd data are quite messed up because the table should include two lines
of gas change information. At least part of the problem lies in lines
55-68 of plannernotes.c.
Unfortunately, I can't reproduce this (don't get an ICD-warning?). But there
is an obvious bug in the handling of the ICD buffer. Could you try the
attached patch?
Thank you,
Berthold
That does fix it. Will you please do a PR?

Kind regards,

willem
--
This message and attachments are subject to a disclaimer.

Please refer to 
http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf
<http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf> for
full
details.
Loading...