[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [kmymoney4] [Bug 372254] Crash when importing CSV file
From:       allan <bugzilla_noreply () kde ! org>
Date:       2016-11-10 13:25:17
Message-ID: bug-372254-17878-iiDfhmP1tF () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=372254

--- Comment #2 from allan <agander93@gmail.com> ---
I think I can see what has happened.
I have created a profile for one of my banks, but I have more than one account
there.  The checking account has one column for the Amount, whereas the savings
account has columns for both credits and debits.  The latter therefore has more
columns, and the column numbers from this account were saved in the resource
file.

If now a checking account is loaded, the saved column details will include more
columns than in the checking file.  Therefore, the result is that an attempt is
made to access a nonexistent column, and an out-of-bounds index is generated.

This happens circa line 576-578 in bankingwizardpage.cpp -

if (!memo.isEmpty())
        memo.append(QChar(QLatin1Char('\n')));
      memo.append(m_columnList[m_wiz->m_memoColList[i]]);

I have inserted

if (m_wiz->m_memoColList[i] < m_columnList.count())  // avoid out of bounds

before the last line to avoid it going out of bounds.

This avoids the problem, but an additional profile will be needed to cover the
different formats.  Has anyone else a more elegant solution?

-- 
You are receiving this mail because:
You are watching all bug changes.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic