Review Request 120129: Fix Iteration of Array mm

David Narváez david.narvaez at computer.org
Thu Sep 11 15:00:18 UTC 2014



> On Sept. 11, 2014, 1:32 p.m., Inge Wallin wrote:
> > objects/curve_imp.cc, line 189
> > <https://git.reviewboard.kde.org/r/120129/diff/1/?file=311163#file311163line189>
> >
> >     Do you need to allocate N+1 doubles when you have changed the while clause to j<N? (and as a side note, why not use
> >     
> >      for (j=0; j<N; ++j) ?
> >      
> >     As another side note, qreal is often a better choice than double because then you will make it possible to compile on ARM too.

Yes to your first question: the last execution of the while loop is j = N - 1, so the last position set (because of the j++ before that) is j = N


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120129/#review66253
-----------------------------------------------------------


On Sept. 10, 2014, 3:13 p.m., David Narváez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120129/
> -----------------------------------------------------------
> 
> (Updated Sept. 10, 2014, 3:13 p.m.)
> 
> 
> Review request for KDE Edu, Maurizio Paolini and Rex Dieter.
> 
> 
> Bugs: 338978
>     http://bugs.kde.org/show_bug.cgi?id=338978
> 
> 
> Repository: kig
> 
> 
> Description
> -------
> 
> Because of the initial value of j it was missing j = 1, causing Valgrind to report a jump over uninitialized value. Because of the check at the while loop, it was modifying j = N + 1, causing a stack buffer overflow.
> 
> 
> Diffs
> -----
> 
>   objects/curve_imp.cc 12931c8 
> 
> Diff: https://git.reviewboard.kde.org/r/120129/diff/
> 
> 
> Testing
> -------
> 
> Valgrinded an execution of Kig creating a locus as described in the bug report.
> 
> 
> Thanks,
> 
> David Narváez
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20140911/e520ca0a/attachment.html>


More information about the kde-edu mailing list