Skip to content

Fix KAddressBook crash when editing a contact with nonstandard phone type

In this case PhoneComboBoxType::setType() attempts to insert the new type as the penultimate item in the mTypeList. However, using an iterator for insertion appears to cause an assertion within QList. There is no need to obtain an interator to do the insertion, the index can be used directly.

Test case: Importing this contact into KAddressBook and attempting to edit it will trigger the crash.

VERSION:3.0 EMAIL;TYPE=PREF,WORK:foo@bar.com EMAIL;TYPE=WORK:info@bar.com FN:Foo Bar N:Bar;Foo;;Mx.; TEL;TYPE=CELL,WORK:0000 000 0000 TEL;TYPE=HOME:01000 000000 END:VCARD

BUG: 494242

Merge request reports

Loading