Fix array access bounds in IMAP resource

Authored by gkowal on Aug 10 2018, 9:17 AM.

Description

Fix array access bounds in IMAP resource

Summary:
ImapQuotaAttribute::serialized() processes IMAP roots assigning corresponding QUOTA and USAGE attributes to each root. It uses three dictionaries: mRoots, mLimits, and mUsages assuming that these dictionaries always have the same number of elements. In a case when mRoots contains more elements than other two dictionaries, this causes referencing to non-existent elements in mLimits and mUsages and segfaults.

Fix this by using mLimits.size() and mUsages.size() in corresponding loops.

BUG: 396980

Reviewers: KDE PIM, dvratil

Reviewed By: KDE PIM, dvratil

Subscribers: mlaurent, cfeck, kde-pim

Tags: KDE PIM

Differential Revision: https://phabricator.kde.org/D14554

Details

Committed
dvratilAug 10 2018, 9:20 AM
Reviewer
KDE PIM
Differential Revision
D14554: Fix array access bounds in IMAP resource
Parents
R44:33c70d204c4a: GIT_SILENT: Prepare 5.9.0
Branches
Unknown
Tags
Unknown