mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
ringaccount: Prevent exiting due to an uncaught exception.
Lookup buddy '>>>>>' and dring would restart. I also added another message in another instance to have a more relevant error message. This has been found by some fuzzing. Change-Id: I484c6449f010567e78dda8e0ae0c4863c7b9ce65
This commit is contained in:

committed by
Adrien Béraud

parent
e1b50fd394
commit
8a3cf4c95a
@ -2016,7 +2016,18 @@ RingAccount::trackBuddyPresence(const std::string& buddy_id)
|
||||
return;
|
||||
}
|
||||
std::weak_ptr<RingAccount> weak_this = std::static_pointer_cast<RingAccount>(shared_from_this());
|
||||
auto h = dht::InfoHash(parseRingUri(buddy_id));
|
||||
|
||||
std::string buddyUri;
|
||||
|
||||
try {
|
||||
buddyUri = parseRingUri(buddy_id);
|
||||
}
|
||||
catch (...) {
|
||||
RING_ERR("Failed to track a buddy due to an invalid URI %s", buddy_id.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
auto h = dht::InfoHash(buddyUri);
|
||||
auto buddy_infop = trackedBuddies_.emplace(h, decltype(trackedBuddies_)::mapped_type {h});
|
||||
if (buddy_infop.second) {
|
||||
auto& buddy_info = buddy_infop.first->second;
|
||||
@ -3282,7 +3293,17 @@ RingAccount::sendTextMessage(const std::string& to, const std::map<std::string,
|
||||
return;
|
||||
}
|
||||
|
||||
auto toUri = parseRingUri(to);
|
||||
std::string toUri;
|
||||
|
||||
try {
|
||||
toUri = parseRingUri(to);
|
||||
}
|
||||
catch (...) {
|
||||
RING_ERR("Failed to send a text message due to an invalid URI %s", to.c_str());
|
||||
messageEngine_.onMessageSent(token, false);
|
||||
return;
|
||||
}
|
||||
|
||||
auto toH = dht::InfoHash(toUri);
|
||||
auto now = clock::to_time_t(clock::now());
|
||||
|
||||
|
Reference in New Issue
Block a user