author | ulf69 <ulf69> | 2004-09-28 21:32:21 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-28 21:32:21 (UTC) |
commit | 551a0bb353c7ffff4b307956a7cc7a023bf36863 (patch) (side-by-side diff) | |
tree | 99a2f40f6c510f8ea2f482d481f2051bd9f2227d | |
parent | 57c00cdf5002e90603e0e1cfb5ac5c2c8bf19fe7 (diff) | |
download | kdepimpi-551a0bb353c7ffff4b307956a7cc7a023bf36863.zip kdepimpi-551a0bb353c7ffff4b307956a7cc7a023bf36863.tar.gz kdepimpi-551a0bb353c7ffff4b307956a7cc7a023bf36863.tar.bz2 |
fixed a potential crash when loading adresses from any adressbook file.
-rw-r--r-- | kabc/vcard/ContentLine.cpp | 10 | ||||
-rw-r--r-- | kabc/vcard/VCardv.cpp | 12 | ||||
-rw-r--r-- | kabc/vcard/include/VCardDefines.h | 3 | ||||
-rw-r--r-- | kabc/vcardformatimpl.cpp | 2 |
4 files changed, 20 insertions, 7 deletions
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp index 0fb5b5d..f7e04a9 100644 --- a/kabc/vcard/ContentLine.cpp +++ b/kabc/vcard/ContentLine.cpp @@ -67,5 +67,8 @@ using namespace VCARD; ContentLine::ContentLine() : Entity(), - value_(0) + value_(0), + paramType_( ParamUnknown ), + valueType_( ValueUnknown ), + entityType_( EntityUnknown ) { paramList_.setAutoDelete( TRUE ); @@ -98,5 +101,8 @@ ContentLine::ContentLine(const ContentLine & x) ContentLine::ContentLine(const QCString & s) : Entity(s), - value_(0) + value_(0), + paramType_( ParamUnknown ), + valueType_( ValueUnknown ), + entityType_( EntityUnknown ) { paramList_.setAutoDelete( TRUE ); diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp index 391a69e..d19a004 100644 --- a/kabc/vcard/VCardv.cpp +++ b/kabc/vcard/VCardv.cpp @@ -189,11 +189,15 @@ VCard::_parse() for (; it2.current(); ++it2) { - - vDebug("New contentline using \"" + QCString(it2.current()) + "\""); + vDebug("New contentline using \"" + QCString(it2.current()) + "\""); ContentLine * cl = new ContentLine(it2.current()); cl->parse(); - - contentLineList_.append(cl); + if (cl->value() == 0) + { + qDebug("Content line could not be parsed. Discarded: %s" + QCString(it2.current())); + delete cl; + } + else + contentLineList_.append(cl); } diff --git a/kabc/vcard/include/VCardDefines.h b/kabc/vcard/include/VCardDefines.h index dd38ae2..557410f 100644 --- a/kabc/vcard/include/VCardDefines.h +++ b/kabc/vcard/include/VCardDefines.h @@ -28,5 +28,6 @@ #ifdef VCARD_DEBUG -#define vDebug(a) kdDebug(5710) << a << endl; +//US #define vDebug(a) kdDebug(5710) << a << endl; +#define vDebug(a) qDebug(a); #else #define vDebug(a) diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp index 2d6eb3d..1bf2cde 100644 --- a/kabc/vcardformatimpl.cpp +++ b/kabc/vcardformatimpl.cpp @@ -262,4 +262,5 @@ bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) kdDebug(5700) << "VCardFormat::load(): Unsupported entity: " << int( type ) << ": " << cl->asString() << endl; + qDebug("VCardFormat::load(): Unsupported entity: %i: %s ", int(type), (const char*)cl->asString()); break; } @@ -640,4 +641,5 @@ QString VCardFormatImpl::readTextValue( ContentLine *cl ) } else { kdDebug(5700) << "No value: " << cl->asString() << endl; + qDebug("No value: %s", (const char*)(cl->asString())); return QString::null; } |