Bug 408026 - Crash during CSV import
Summary: Crash during CSV import
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: 5.0.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-28 11:38 UTC by Thomas Baumgart
Modified: 2019-05-28 11:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Baumgart 2019-05-28 11:38:26 UTC
SUMMARY
When switching CSV profiles KMyMoney may crash during next import

STEPS TO REPRODUCE
1. Import CSV file with profile that contains a number column assignment of e.g. 6
2. Import CSV file with the same profile where the file only has 3 columns and re-assign the columns (number not assigned)

OBSERVED RESULT
KMyMoney crashes during import.

EXPECTED RESULT
KMyMoney should import the file w/o crash

ADDITIONAL INFORMATION
The problem is, that the index for the UI is handled correctly, but the column assignment in the underlying profile still contains the old column assignment of 6 which produces a value out of bounds.
Comment 1 Thomas Baumgart 2019-05-28 11:52:45 UTC
Git commit 09fc41b4b872e0a5ec4ce2b955f99c04ae975d91 by Thomas Baumgart.
Committed on 28/05/2019 at 11:52.
Pushed by tbaumgart into branch '5.0'.

Reset column assignment when out of bounds

In case the column assignment is cleared using the clear all button, the
profile is not updated because there is no change in index in combobox
widget and the connected slot for profile update will never be called.

This change makes sure that in such a case (previous assignment is out
of bounds for the current file) the assignment is reset before it is
used. This avoids the out-of-bounds crash later on.
FIXED-IN: 5.0.5

M  +5    -0    kmymoney/plugins/csv/import/bankingwizardpage.cpp

https://commits.kde.org/kmymoney/09fc41b4b872e0a5ec4ce2b955f99c04ae975d91