Summary: | A half-empty PRICEPAIR causes app to crash when attempting to update prices | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Dawid Wróbel <me> |
Component: | general | Assignee: | Dawid Wróbel <me> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | git (master) | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | All | ||
Latest Commit: | https://invent.kde.org/office/kmymoney/commit/3b1356da845f2da7f6d66b9dea3cbca837f3e2c9 | Version Fixed In: | 5.1.2 |
Sentry Crash Report: |
Description
Dawid Wróbel
2020-06-07 02:10:11 UTC
I attempted to add !pair.second.isEmpty() check to the expression mentioned in 2) and 3), and while that stopped the crashing immediately, it... reversed the PRICEPAIR in the .kmy file: <PRICEPAIR to="" from="PLN"> <PRICE source="Transaction" date="2013-11-12" price="1/1"/> <PRICE source="Transaction" date="2014-02-03" price="1/1"/> <PRICE source="Transaction" date="2019-06-28" price="1/1"/> <PRICE source="Transaction" date="2019-10-04" price="1/1"/> <PRICE source="KMyMoney Currency" date="2020-03-20" price="1/1"/> </PRICEPAIR> I have noticed today that I also have a similar section with USD: <PRICEPAIR to="" from="USD"> <PRICE date="2015-10-30" source="Transaction" price="1/1"/> (...) <PRICE date="2021-04-01" source="Transaction" price="1/1"/> <PRICE date="2021-05-05" source="Transaction" price="1/1"/> </PRICEPAIR> Worth noticing is that it keeps getting updated somehow. A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/88 Git commit 4e1d62d3903e4eca70e06c9dc4cc4d239be36cfa by Dawid Wróbel. Committed on 02/06/2021 at 15:42. Pushed by wrobelda into branch '5.1'. Make sure prices are actual pairs when updating When passing a pair to addPricePair() in Update Stock and Currency Prices dialog, actually make sure that both elements are non-empty in order to avoid an undefined behavior and SEGFAULTS. FIXED-IN: 5.1.2 M +8 -0 kmymoney/dialogs/kequitypriceupdatedlg.cpp https://invent.kde.org/office/kmymoney/commit/4e1d62d3903e4eca70e06c9dc4cc4d239be36cfa Git commit 3b1356da845f2da7f6d66b9dea3cbca837f3e2c9 by Dawid Wrobel, on behalf of Dawid Wróbel. Committed on 02/06/2021 at 16:25. Pushed by wrobelda into branch 'master'. Make sure prices are actual pairs when updating When passing a pair to addPricePair() in Update Stock and Currency Prices dialog, actually make sure that both elements are non-empty in order to avoid an undefined behavior and SEGFAULTS. FIXED-IN: 5.1.2 (cherry picked from commit 4e1d62d3903e4eca70e06c9dc4cc4d239be36cfa) M +8 -0 kmymoney/dialogs/kequitypriceupdatedlg.cpp https://invent.kde.org/office/kmymoney/commit/3b1356da845f2da7f6d66b9dea3cbca837f3e2c9 |