[Pkg-kde-extras] Bug#574600: [kmymoney] Crashes when clicking on save

2010-03-21 Thread Matthias Dellweg
This Patch solves the Issue for me.
But it is hot stitched as I do not understand how the function logic works. 
Why is it assumed there is a one on one relationship between userIDs and 
subkeys?

--- kmymoney-3.96.1.orig/libkgpgfile/kgpgfile.cpp
+++ kmymoney-3.96.1/libkgpgfile/kgpgfile.cpp
@@ -307,7 +307,7 @@ void KGPGFile::keyList(QStringList list

   std::vectorGpgME::UserID userIDs = key.userIDs();
   std::vectorGpgME::Subkey subkeys = key.subkeys();
-  for (unsigned int i = 0; i  userIDs.size(); ++i) {
+  for (unsigned int i = 0; i  std::min(userIDs.size(), subkeys.size()); 
++i) {
 const GpgME::Subkey skey = subkeys[i];

 if (!(skey.isRevoked() || skey.isExpired() || skey.isInvalid()  || 
skey.isDisabled())) {



___
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras


[Pkg-kde-extras] Bug#574600: [kmymoney] Crashes when clicking on save

2010-03-19 Thread Robert Wohlrab
Package: kmymoney
Version: 3.96.1-1
Severity: normal

Opened a file from kmymoney2 (1.0.2-1) and clicked on save. The program just
crashes. I cannot provide a real backtrace because your program doesn't
provide a -dbg package.

#0  GpgME::Subkey::isRevoked (this=0x2181818) at ../../gpgme++/key.cpp:374
No locals.
#1  0x009089ae in ?? ()
No symbol table info available.
#2  0x0090a409 in ?? ()
No symbol table info available.
#3  0x004b83d0 in _start ()
No symbol table info available.

The opened file is just a gpg encrypted xml file.

Ok, just rebuild kmymoney with 
 export DEB_BUILD_OPTIONS=parallel=5 nostrip debug noopt

#0  GpgME::Subkey::isRevoked (this=0x1d849a0) at ../../gpgme++/key.cpp:374
No locals.
#1  0x009089ae in KGPGFile::keyList (this=value optimized out, 
list=..., secretKeys=value optimized out, 
pattern=value optimized out)
at /home/rowo/tmp/kmymoney-3.96.1/libkgpgfile/kgpgfile.cpp:313
skey = @0x1d849a0
i = 4
key = {static null = {No data fields}, key = {px = 0x15bfb10, pn = 
{pi_ = 0x1d895d0}}}
needPushBack = false
userIDs = {std::_Vector_baseGpgME::UserID, 
std::allocatorGpgME::UserID  = {
_M_impl = {std::allocatorGpgME::UserID = 
{__gnu_cxx::new_allocatorGpgME::UserID = {No data fields}, 
No data fields}, _M_start = 0x1d83e20, _M_finish = 0x1d83ee0,
  _M_end_of_storage = 0x1d83ee0}}, No data fields}
subkeys = {std::_Vector_baseGpgME::Subkey, 
std::allocatorGpgME::Subkey  = {
_M_impl = {std::allocatorGpgME::Subkey = 
{__gnu_cxx::new_allocatorGpgME::Subkey = {No data fields}, 
No data fields}, _M_start = 0x1d84940, _M_finish = 0x1d849a0,
  _M_end_of_storage = 0x1d849a0}}, No data fields}
error = {mErr = 0, mMessage = {static npos = 18446744073709551615, 
_M_dataplus = {std::allocatorchar = 
{__gnu_cxx::new_allocatorchar = {No data fields}, No data fields},
  _M_p = 0x3a3af01138 }}}
#2  0x0090a245 in KGPGFile::keyAvailable (name=...) at 
/home/rowo/tmp/kmymoney-3.96.1/libkgpgfile/kgpgfile.cpp:275
file = {QFile = {QIODevice = {QObject = {_vptr.QObject = 
0xc448d0, static staticMetaObject = {d = {superdata = 
0x0, stringdata = 0x3a3b1e6ac0 QObject, data = 0x3a3b1e6b60,
extradata = 0x3a3b43b700}}, d_ptr = 0x1d81da0, static 
staticQtMetaObject = {d = {superdata = 0x0, 
stringdata = 0x3a3b1f0340 Qt, data = 0x3a3b1f36c0, extradata = 0x0}}},
  static staticMetaObject = {d = {superdata = 0x3a3b43b6e0, 
stringdata = 0x3a3b1f7ac0 QIODevice, data = 
0x3a3b1f7b20, extradata = 0x0}}}, static staticMetaObject = {d = {
superdata = 0x3a3b441820, stringdata = 0x3a3b1f7a60 QFile, 
data = 0x3a3b1f7a80, extradata = 0x0}}}, static 
staticMetaObject = {d = {superdata = 0x3a3b4416e0,
  stringdata = 0x957d00 KGPGFile, data = 0x957d20, extradata = 
0x0}}, d = 0x26f7fa0}
keys = {QListQString = {{p = {static shared_null = {ref = {_q_value 
= 44973}, alloc = 0, begin = 0, end = 0, 
sharable = 1, array = {0x0}}, d = 0x1d89250}, d = 0x1d89250}}, No data fields}
#3  0x004b7b4e in KMyMoneyView::saveToLocalFile (this=value optimized 
out, localFile=value optimized out, 
pWriter=value optimized out, plaintext=value optimized out,
keyList=value optimized out) at 
/home/rowo/tmp/kmymoney-3.96.1/kmymoney/views/kmymoneyview.cpp:1017
keys = {QListQString = {{p = {static shared_null = {ref = {_q_value 
= 44973}, alloc = 0, begin = 0, end = 0, 
sharable = 1, array = {0x0}}, d = 0x1d84d00}, d = 0x1d84d00}}, No data fields}
qfile = {QFile = {QIODevice = {QObject = {_vptr.QObject = 
0x3dd967dc50, static staticMetaObject = {d = 
{superdata = 0x0, stringdata = 0x3a3b1e6ac0 QObject, data = 0x3a3b1e6b60,
extradata = 0x3a3b43b700}}, d_ptr = 0x26980f0, static 
staticQtMetaObject = {d = {superdata = 0x0, 
stringdata = 0x3a3b1f0340 Qt, data = 0x3a3b1f36c0, extradata = 0x0}}},
  static staticMetaObject = {d = {superdata = 0x3a3b43b6e0, 
stringdata = 0x3a3b1f7ac0 QIODevice, data = 
0x3a3b1f7b20, extradata = 0x0}}}, static staticMetaObject = {d = {
superdata = 0x3a3b441820, stringdata = 0x3a3b1f7a60 QFile, 
data = 0x3a3b1f7a80, extradata = 0x0}}}, d = 
0x2645880}
dev = value optimized out
statusDevice = value optimized out
ft = {m_isNested = 96, m_needRollback = 237}
base = value optimized out
encryptedOk = true
encryptRecover = false
blocked = value optimized out
#4  0x004b941c in KMyMoneyView::saveFile (this=0xfced60, url=..., 
keyList=value optimized out) at 
/home/rowo/tmp/kmymoney-3.96.1/kmymoney/views/kmymoneyview.cpp:1154
fmode = 420
gid = 1000
fi = {d_ptr = 0x1105fb0}
filename = {static null = {No data fields}, static shared_null = {ref 
= {_q_value = 25586}, alloc = 0, size = 0, 
data = 0x3a3b446aba, clean = 0, simpletext = 0, 

[Pkg-kde-extras] Bug#574600: [kmymoney] Crashes when clicking on save

2010-03-19 Thread Matthias Dellweg
Same problem here.
I searched for isRevoked in kmymoney and I found an assumption in 
libkgpgfile.cpp around line 311 which seems incorrect.

As you see there:

std::vectorGpgME::UserID userIDs = key.userIDs();
std::vectorGpgME::Subkey subkeys = key.subkeys();
for (unsigned int i = 0; i  userIDs.size(); ++i) {
  const GpgME::Subkey skey = subkeys[i];
  if (!(skey.isRevoked() || skey.isExpired() || skey.isInvalid() ||
skey.isDisabled()))

it is assumed that a gpg key has the same number of userIDs and subkeys.
As far as I can see, my key has one subkey and multiple userIDs.
Hope this helps.
Greetings, Matthias



___
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras