Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libQuotient for openSUSE:Factory checked in at 2021-03-18 22:55:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libQuotient (Old) and /work/SRC/openSUSE:Factory/.libQuotient.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libQuotient" Thu Mar 18 22:55:04 2021 rev:4 rq:879798 version:0.6.6 Changes: -------- --- /work/SRC/openSUSE:Factory/libQuotient/libQuotient.changes 2021-02-25 18:27:46.118193391 +0100 +++ /work/SRC/openSUSE:Factory/.libQuotient.new.2401/libQuotient.changes 2021-03-18 22:55:05.975541145 +0100 @@ -1,0 +2,7 @@ +Thu Mar 18 05:51:58 UTC 2021 - Dead Mozay <dead_mo...@opensuse.org> + +- Update to version 0.6.6: + * Another update on the stable branch, to address #456 + (possible crash on some malformed user ids). + +------------------------------------------------------------------- Old: ---- 0.6.5.tar.gz New: ---- 0.6.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libQuotient.spec ++++++ --- /var/tmp/diff_new_pack.gBVeMe/_old 2021-03-18 22:55:08.551543928 +0100 +++ /var/tmp/diff_new_pack.gBVeMe/_new 2021-03-18 22:55:08.555543932 +0100 @@ -19,7 +19,7 @@ %define soversion 0_6 %bcond_with e2ee Name: libQuotient -Version: 0.6.5 +Version: 0.6.6 Release: 0 Summary: Library for Qt Matrix Clients License: LGPL-2.1-only ++++++ 0.6.5.tar.gz -> 0.6.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libQuotient-0.6.5/CMakeLists.txt new/libQuotient-0.6.6/CMakeLists.txt --- old/libQuotient-0.6.5/CMakeLists.txt 2021-02-21 22:28:57.000000000 +0100 +++ new/libQuotient-0.6.6/CMakeLists.txt 2021-03-17 21:23:20.000000000 +0100 @@ -4,7 +4,7 @@ endif() set(API_VERSION "0.6") -project(Quotient VERSION "${API_VERSION}.5" LANGUAGES CXX) +project(Quotient VERSION "${API_VERSION}.6" LANGUAGES CXX) option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) # https://github.com/quotient-im/libQuotient/issues/369 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libQuotient-0.6.5/lib/connection.cpp new/libQuotient-0.6.6/lib/connection.cpp --- old/libQuotient-0.6.5/lib/connection.cpp 2021-02-21 22:28:57.000000000 +0100 +++ new/libQuotient-0.6.6/lib/connection.cpp 2021-03-17 21:23:20.000000000 +0100 @@ -691,7 +691,7 @@ DirectChatsMap remoteAdditions; for (auto it = usersToDCs.begin(); it != usersToDCs.end(); ++it) { - if (auto* u = q->user(it.key())) { + if (auto* const u = q->user(it.key())) { if (!directChats.contains(u, it.value()) && !dcLocalRemovals.contains(u, it.value())) { Q_ASSERT(!directChatUsers.contains(it.value(), u)); @@ -924,6 +924,12 @@ const QJsonObject& creationContent) { invites.removeOne(userId()); // The creator is by definition in the room + for (const auto& i : invites) + if (!user(i)) { + qCWarning(MAIN) << "Won't create a room with malformed invitee ids"; + return nullptr; + } + auto job = callApi<CreateRoomJob>(visibility == PublishRoom ? QStringLiteral("public") : QStringLiteral("private"), @@ -958,7 +964,7 @@ void Connection::doInDirectChat(const QString& userId, const std::function<void(Room*)>& operation) { - if (auto* u = user(userId)) + if (auto* const u = user(userId)) doInDirectChat(u, operation); else qCCritical(MAIN) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libQuotient-0.6.5/lib/room.cpp new/libQuotient-0.6.6/lib/room.cpp --- old/libQuotient-0.6.5/lib/room.cpp 2021-02-21 22:28:57.000000000 +0100 +++ new/libQuotient-0.6.6/lib/room.cpp 2021-03-17 21:23:20.000000000 +0100 @@ -1460,7 +1460,9 @@ QString Room::roomMembername(const QString& userId) const { - return roomMembername(user(userId)); + if (auto* const u = user(userId)) + return roomMembername(u); + return {}; } QString Room::safeMemberName(const QString& userId) const @@ -2349,7 +2351,7 @@ // the new message events. if (const auto senderId = (*from)->senderId(); !senderId.isEmpty()) { auto* const firstWriter = q->user(senderId); - if (q->readMarker(firstWriter) != timeline.crend()) { + if (firstWriter && q->readMarker(firstWriter) != timeline.crend()) { roomChanges |= promoteReadMarker(firstWriter, rev_iter_t(from) - 1); qCDebug(MESSAGES) @@ -2418,6 +2420,13 @@ if (!e.isStateEvent()) return Change::NoChange; + auto* const sender = user(e.senderId()); + if (!sender) { + qCWarning(MAIN) << "State event" << e.id() + << "is invalid and won't be processed"; + return Change::NoChange; + } + // Find a value (create an empty one if necessary) and get a reference // to it. Can't use getCurrentState<>() because it (creates and) returns // a stub if a value is not found, and what's needed here is a "real" event @@ -2426,9 +2435,9 @@ // Prepare for the state change const auto oldRme = static_cast<const RoomMemberEvent*>(curStateEvent); visit(e, [this, &oldRme](const RoomMemberEvent& rme) { - auto* u = user(rme.userId()); - if (!u) { // ??? - qCCritical(MAIN) + auto* const u = user(rme.userId()); + if (!u) { // Invalid user id? + qCWarning(MAIN) << "Could not get a user object for" << rme.userId(); return; } @@ -2517,9 +2526,11 @@ emit avatarChanged(); return AvatarChange; } - , [this,oldRme] (const RoomMemberEvent& evt) { + , [this,oldRme,sender] (const RoomMemberEvent& evt) { // clang-format on auto* u = user(evt.userId()); + if (!u) + return NoChange; // Already warned earlier // TODO: remove in 0.7 u->processEvent(evt, this, oldRme == nullptr); @@ -2539,7 +2550,7 @@ if (!d->usersInvited.contains(u)) d->usersInvited.push_back(u); if (u == localUser() && evt.isDirect()) - connection()->addToDirectChats(this, user(evt.senderId())); + connection()->addToDirectChats(this, sender); break; case MembershipType::Knock: case MembershipType::Ban: @@ -2599,8 +2610,8 @@ if (auto* evt = eventCast<TypingEvent>(event)) { d->usersTyping.clear(); for (const QString& userId : qAsConst(evt->users())) { - auto u = user(userId); - if (memberJoinState(u) == JoinState::Join) + auto* const u = user(userId); + if (u && memberJoinState(u) == JoinState::Join) d->usersTyping.append(u); } if (evt->users().size() > 3 || et.nsecsElapsed() >= profilerMinNsecs()) @@ -2625,8 +2636,8 @@ for (const Receipt& r : p.receipts) { if (r.userId == connection()->userId()) continue; // FIXME, #185 - auto u = user(r.userId); - if (memberJoinState(u) == JoinState::Join) + auto* const u = user(r.userId); + if (u && memberJoinState(u) == JoinState::Join) changes |= d->promoteReadMarker(u, newMarker); } } else { @@ -2639,8 +2650,8 @@ for (const Receipt& r : p.receipts) { if (r.userId == connection()->userId()) continue; // FIXME, #185 - auto u = user(r.userId); - if (memberJoinState(u) == JoinState::Join + auto* const u = user(r.userId); + if (u && memberJoinState(u) == JoinState::Join && readMarker(u) == timelineEdge()) changes |= d->setLastReadEvent(u, p.evtId); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libQuotient-0.6.5/lib/uriresolver.cpp new/libQuotient-0.6.6/lib/uriresolver.cpp --- old/libQuotient-0.6.5/lib/uriresolver.cpp 2021-02-21 22:28:57.000000000 +0100 +++ new/libQuotient-0.6.6/lib/uriresolver.cpp 2021-03-17 21:23:20.000000000 +0100 @@ -24,9 +24,9 @@ case Uri::UserId: { if (uri.action() == "join") return IncorrectAction; - auto* user = account->user(uri.primaryId()); - Q_ASSERT(user != nullptr); - return visitUser(user, uri.action()); + if (auto* const user = account->user(uri.primaryId())) + return visitUser(user, uri.action()); + return InvalidUri; } case Uri::RoomId: case Uri::RoomAlias: {