Commit 307dde7b authored by Tomáš Trnka's avatar Tomáš Trnka Committed by Laurent Montel
Browse files

Avoid accidentally generating reserved values of feed IDs

parent 2f6d4e23
Pipeline #57633 canceled with stage
......@@ -18,6 +18,7 @@
#include "kernel.h"
#include "subscriptionlistjobs.h"
#include <KLocalizedString>
#include <limits>
#include <memory>
#include <QElapsedTimer>
......@@ -436,7 +437,8 @@ void FeedList::setRootNode(Folder *folder)
uint FeedList::generateID() const
{
return QRandomGenerator::global()->generate();
// The values 0 and 1 are reserved, see TreeNode::id()
return QRandomGenerator::global()->bounded(2u, std::numeric_limits<quint32>::max());
}
void FeedList::slotNodeAdded(TreeNode *node)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment