[Kde-pim] Re: Review Request: When processing a parenthesized list, make sure there is enough data

Andras Mantia amantia at kde.org
Tue Oct 19 08:19:51 BST 2010



> On 2010-10-19 05:56:11, Andras Mantia wrote:
> > One more note: the same needs to be done in kdesupport/akonadi/server/src .
> 
> Robert Marmorstein wrote:
>     Okay.  I'll take care of both.
> 
> Robert Marmorstein wrote:
>     One more question: 
>     
>     In readLiteralPart, should the < be a <= in the following code?  We use <= pretty much everywhere else, but we don't add "size" everywhere else.
>     
>     if ( !waitForMoreData( m_data.length() < m_position + size ) )
>         throw ImapParserException("Unable to read more data");
>     
>     
>

Probably yes, but I don't remember why it is < and not <=. From just reading the code <= should also work. But don't do the change without making sure the unit tests from kdesupport/akonadi/server/tests/unittest pass. Speaking of unit tests, you should try to add a unit test for the bug you've discovered as well.


- Andras


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


On 2010-10-19 06:09:49, Robert Marmorstein wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5657/
> -----------------------------------------------------------
> 
> (Updated 2010-10-19 06:09:49)
> 
> 
> Review request for KDE PIM, Kevin Krammer and Kevin Ottens.
> 
> 
> Summary
> -------
> 
> I experienced a crash in ImapStreamParser::readParenthesizedList() that was caused by m_position becoming larger than the size of the QByteArray.  I will admit I don't understand this code thorougly, but it looks to me like the correct solution is to use the waitForMoreData function to prevent this from happening, so here is a patch that does that.  Please feel free to be critical -- I would really like to understand this code, so any comments or suggestions will be delightfully accepted as constructive feedback.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdepimlibs/kimap/imapstreamparser.cpp 1187364 
> 
> Diff: http://svn.reviewboard.kde.org/r/5657/diff
> 
> 
> Testing
> -------
> 
> The imap resource used to crash pretty much every time I started kontact or kmail.  Now it doesn't.  
> 
> 
> Thanks,
> 
> Robert
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list