Skip to content
Snippets Groups Projects
Commit 73ab348b authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

account: Prevent possible off by one array access

Refs #68200
parent b7a5d854
No related branches found
No related tags found
No related merge requests found
...@@ -430,7 +430,7 @@ void AccountStatusModel::addSipRegistrationEvent(const QString& fallbackMessage, ...@@ -430,7 +430,7 @@ void AccountStatusModel::addSipRegistrationEvent(const QString& fallbackMessage,
void AccountStatusModel::addTransportEvent(const QString& fallbackMessage, int errorCode) void AccountStatusModel::addTransportEvent(const QString& fallbackMessage, int errorCode)
{ {
if (errorCode != d_ptr->m_pAccount->lastTransportErrorCode()) { if (!d_ptr->m_lRows.size() || errorCode != d_ptr->m_pAccount->lastTransportErrorCode()) {
beginInsertRows(QModelIndex(), d_ptr->m_lRows.size(), d_ptr->m_lRows.size()); beginInsertRows(QModelIndex(), d_ptr->m_lRows.size(), d_ptr->m_lRows.size());
d_ptr->m_lRows << new AccountStatusRow(fallbackMessage, errorCode, Type::TRANSPORT); d_ptr->m_lRows << new AccountStatusRow(fallbackMessage, errorCode, Type::TRANSPORT);
endInsertRows(); endInsertRows();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment