[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kopete-devel
Subject:    [kopete-devel] [PATCH] Avoiding to test on end()
From:       Michel Hermier <michel.hermier () wanadoo ! fr>
Date:       2005-06-25 15:41:11
Message-ID: 200506251743.38174.michel.hermier () wanadoo ! fr
[Download RAW message or body]

Hi,
This patch avoids to loop until reaching end(); while decrementing the iterator.
The current code is wrong for 2 reasons:
- decrementing to the begin of the list doesn't return the same value as end();
- decrementing to the iterator at the first place, is undefined (see
http://doc.trolltech.com/3.3/qmapiterator.html#operator-- )
So this provoke an invalid read (potential crash).

Comments? commit?

Cheers,
	Michel

_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic