Review Request: Resubmit: Fix to game of life applet to avoid accessing memory outside bounds of array.

Marco Martin notmart at gmail.com
Tue Jun 22 18:35:23 CEST 2010



> On 2010-06-21 14:59:37, Marco Martin wrote:
> > good catch
> 
> obby wrote:
>     Hi Marco,
>     
>     This is the first patch I've ever submitted to the review board. What's the process like from here? I currently don't have a subversion account; will another developer submit this patch?
>     
>     I'm hoping to become a regular contributor, should I apply for an SVN account now? Or wait until I have a few more patches before applying for an account?
>     
>     Any tips would be greatly appreciated! Thanks for your time and review.

committed, please mark as submitted :)


- Marco


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4363/#review6216
-----------------------------------------------------------


On 2010-06-21 14:52:36, obby wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4363/
> -----------------------------------------------------------
> 
> (Updated 2010-06-21 14:52:36)
> 
> 
> Review request for Plasma.
> 
> 
> Summary
> -------
> 
> Note: This review request replaces former request http://reviewboard.kde.org/r/4361/ which was discarded after several attempts to upload an updated diff failed. I apologize for the extra mail. The original fix contained another bug which would cause a crash if the game board was not symmetrical.
> 
> This patch fixes an off-by-one error which led to accessing memory just outside of the cells array. It also kept the first character in the cells array from ever being displayed on the board properly, and a bunch of crazy math to keep the rules of the game intact. (The last cell displayed was reflecting the state of memory outside of the cells array.)
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdeplasma-addons/applets/life/life.h 1138875 
>   /trunk/KDE/kdeplasma-addons/applets/life/life.cpp 1138875 
> 
> Diff: http://reviewboard.kde.org/r/4363/diff
> 
> 
> Testing
> -------
> 
> Testing Done:
> Aside from the initial test cases which were used to confirm the bug (hard coding one char in the cells array to always be 1 and moving it around to find the bounds of the display,) I also generated a few other board states manually using examples found here:
> http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
> 
> "Blinker" and "Toad" were two that were used to test.
> 
> Note: The bug in the original fix (diff in previous review request mentioned above) led to a crash when the gameboard was resized to be non-square. After fixing that bug, I tried several random board sizes, and they all worked.
> 
> 
> Thanks,
> 
> obby
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100622/3df82362/attachment-0001.htm 


More information about the Plasma-devel mailing list