Fix possible XCA crash

Someone experienced an XCA crash on Fedora 29 and reported it.
Unfortunately this is an automatic reporting with
no "human-generated" details.

 #5  pki_multi::count (this=0x0) at /usr/src/debug/xca-2.1.2-3.fc31.x86_64/lib/pki_multi.h:32
 #6  MainWindow::probeAnything (this=<optimized out>, file=..., ret=0x7ffdd1258a10) at MainWindow.cpp:816
        pki = 0x0
 #7  0x000000000053dba8 in MainWindow::read_cmdline (this=this@entry=0xac1000, argc=2, argv=argv@entry=0x7ffdd1258bd8) at /usr/include/qt5/QtCore/qrefcount.h:60
This commit is contained in:
Patrick Monnerat 2019-12-03 13:27:04 +01:00 committed by Christian Hohnstaedt
parent 68c31352ba
commit 262c805f2e

View File

@ -825,12 +825,12 @@ pki_multi *MainWindow::probeAnything(QString file, int *ret)
} catch (errorEx &err) {
Error(err);
}
if (!pki->count()) {
if (pki && !pki->count()) {
delete pki;
pki = NULL;
if (ret)
*ret = 1;
}
if (!pki && ret)
*ret = 1;
return pki;
}