Bug 343757 - Crash when importing CSV investment file
Summary: Crash when importing CSV investment file
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: git (master)
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: allan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-04 00:29 UTC by allan
Modified: 2017-07-01 11:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.2


Attachments
Patch to fix problem. (6.21 KB, patch)
2015-02-06 20:24 UTC, allan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description allan 2015-02-04 00:29:36 UTC
Crash happened with a test file I've imported thousands of times, with all paramaters saved from last use.

However, as I was not using my main PC, instead of using the usual saved fields for symbol and description, this time, I deleted those settings and supplied instead the security name.

However, the act of clearing those field column numbers resulting in an array index going out of bounds, the result being the crash.


Reproducible: Always

Steps to Reproduce:
1.Import an investment CSV file that contains a sticker symbol.
2.On the investment wizard page, delete that setting and instead supply
   the security name.
3.Proceed with the import, until the crash occurs.

Actual Results:  
As above.

Expected Results:  
No crash.

Whilst it was legitimate to have cleared the combo box paramaters, addition settings also need to be cleared.
Patch to follow.
Comment 1 allan 2015-02-06 20:24:21 UTC
Created attachment 90953 [details]
Patch to fix problem.

I'll commit the patch in a week or so, barring any objections.
Comment 2 allan 2015-03-03 14:04:37 UTC
Git commit 8706b8724878258f11de713eff2422a2249c2a63 by Allan Anderson.
Committed on 06/02/2015 at 17:43.
Pushed by allananderson into branch 'master'.
Fix crash when importing CSV investment file

M  +1    -1    kmymoney/plugins/csvimport/csvdialog.cpp
M  +0    -0    kmymoney/plugins/csvimport/csvdialog.h
M  +31   -10   kmymoney/plugins/csvimport/investprocessing.cpp
M  +2    -0    kmymoney/plugins/csvimport/redefinedlg.cpp

http://commits.kde.org/kmymoney/8706b8724878258f11de713eff2422a2249c2a63
Comment 3 allan 2015-03-03 14:04:38 UTC
Git commit a5cebcd383b6e4a1b30418a296ac0cd879b31395 by Allan Anderson.
Committed on 06/02/2015 at 17:43.
Pushed by allananderson into branch 'master'.
Fix crash when importing CSV investment file after editing settings.

M  +4    -2    kmymoney/plugins/csvimport/investprocessing.cpp

http://commits.kde.org/kmymoney/a5cebcd383b6e4a1b30418a296ac0cd879b31395
Comment 4 allan 2015-03-05 14:17:38 UTC
Git commit 9dab50bf3948488bd0281874eee71a75efa9bcde by Allan Anderson.
Committed on 06/02/2015 at 17:43.
Pushed by allananderson into branch '4.7'.
Fix crash when importing CSV investment file

M  +1    -1    kmymoney/plugins/csvimport/csvdialog.cpp
M  +0    -0    kmymoney/plugins/csvimport/csvdialog.h
M  +31   -10   kmymoney/plugins/csvimport/investprocessing.cpp
M  +2    -0    kmymoney/plugins/csvimport/redefinedlg.cpp

http://commits.kde.org/kmymoney/9dab50bf3948488bd0281874eee71a75efa9bcde
Comment 5 allan 2015-03-05 14:17:39 UTC
Git commit 075cf48505bf1d5714d94378e28770ecbbb8e61a by Allan Anderson.
Committed on 06/02/2015 at 17:43.
Pushed by allananderson into branch '4.7'.
Fix crash when importing CSV investment file after editing settings.

M  +4    -2    kmymoney/plugins/csvimport/investprocessing.cpp

http://commits.kde.org/kmymoney/075cf48505bf1d5714d94378e28770ecbbb8e61a