Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-12-04 Thread Lubomir I. Ivanov
On 4 December 2015 at 08:10, K. "pestophagous" Heller wrote: > Signed-off-by: K. Heller > --- > > This a RESUBMIT. (labeling it as such for clarity.) > > These are the same two lines I submitted on Nov 24. > > This patch held up under scrutiny in November already, see here: > http://lists.subsurf

[PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-12-03 Thread K. "pestophagous" Heller
Signed-off-by: K. Heller --- This a RESUBMIT. (labeling it as such for clarity.) These are the same two lines I submitted on Nov 24. This patch held up under scrutiny in November already, see here: http://lists.subsurface-divelog.org/pipermail/subsurface/2015-November/thread.html#23414 Lubomir

Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-25 Thread Lubomir I. Ivanov
On 25 November 2015 at 20:48, K. "pestophagous" Heller wrote: > On Wed, Nov 25, 2015 at 10:38 AM, Lubomir I. Ivanov > wrote: >>> + if (idx < 0) >>> + // convert an idx of -1 so we do insert-at-end: >>> + idx = dive_table.nr - 1; >> >> forgot to mention that in t

Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-25 Thread K. "pestophagous" Heller
On Wed, Nov 25, 2015 at 10:38 AM, Lubomir I. Ivanov wrote: > On 25 November 2015 at 07:26, K. "pestophagous" Heller > wrote: >> Signed-off-by: K. Heller >> --- >> >> add_single_dive is called with idx = -1 in the mobile app. >> Then a crash can happen afterward in several places >> depending on

Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-25 Thread Lubomir I. Ivanov
On 25 November 2015 at 07:26, K. "pestophagous" Heller wrote: > Signed-off-by: K. Heller > --- > > add_single_dive is called with idx = -1 in the mobile app. > Then a crash can happen afterward in several places > depending on whether the timer first triggers the QMLProfile > to repaint or whethe

Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-25 Thread K. "pestophagous" Heller
On Wed, Nov 25, 2015 at 10:16 AM, Lubomir I. Ivanov wrote: > On 25 November 2015 at 20:01, K. "pestophagous" Heller > wrote: >> On Wed, Nov 25, 2015 at 6:53 AM, Lubomir I. Ivanov >> wrote: >>> >>> currently add_single_dive() assumes a safe index. >>> i think that add_single_dive() should not be

Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-25 Thread Lubomir I. Ivanov
On 25 November 2015 at 20:01, K. "pestophagous" Heller wrote: > On Wed, Nov 25, 2015 at 6:53 AM, Lubomir I. Ivanov > wrote: >> >> currently add_single_dive() assumes a safe index. >> i think that add_single_dive() should not be touched, but instead the >> mobile app should be fixed (models bug?)

Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-25 Thread K. "pestophagous" Heller
On Wed, Nov 25, 2015 at 6:53 AM, Lubomir I. Ivanov wrote: >> subsurface-core/divelist.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/subsurface-core/divelist.c b/subsurface-core/divelist.c >> index a14fabf..a2e94c0 100644 >> --- a/subsurface-core/divelist.c >> +++ b/subsurface-c

Re: [PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-25 Thread Lubomir I. Ivanov
On 25 November 2015 at 07:26, K. "pestophagous" Heller wrote: > Signed-off-by: K. Heller > --- > > add_single_dive is called with idx = -1 in the mobile app. > Then a crash can happen afterward in several places > depending on whether the timer first triggers the QMLProfile > to repaint or whethe

[PATCH] Crash fix in add_single_dive. No writing to dive_table.dives[-1]

2015-11-24 Thread K. "pestophagous" Heller
Signed-off-by: K. Heller --- add_single_dive is called with idx = -1 in the mobile app. Then a crash can happen afterward in several places depending on whether the timer first triggers the QMLProfile to repaint or whether QtQuick tries further interactions with the DiveListModel. to reproduce