Mailinglist Archive: opensuse-commit (817 mails)

< Previous Next >
commit kdepimlibs4 for openSUSE:Factory
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Thu, 04 Dec 2008 12:58:38 +0100
  • Message-id: <20081204115838.E6828678176@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package kdepimlibs4 for openSUSE:Factory
checked in at Thu Dec 4 12:58:38 CET 2008.


--------
--- KDE/kdepimlibs4/kdepimlibs4.changes 2008-12-02 15:35:56.000000000 +0100
+++ /mounts/work_src_done/STABLE/kdepimlibs4/kdepimlibs4.changes
2008-12-04 12:47:07.000000000 +0100
@@ -1,0 +2,5 @@
+Thu Dec 4 12:45:43 CET 2008 - wstephenson@xxxxxxx
+
+- Fix korganizer crash on corrupt uidmap file (bnc#441363)
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
r892407-idmapper-robustness.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdepimlibs4.spec ++++++
--- /var/tmp/diff_new_pack.bR3111/_old 2008-12-04 12:58:23.000000000 +0100
+++ /var/tmp/diff_new_pack.bR3111/_new 2008-12-04 12:58:23.000000000 +0100
@@ -24,13 +24,14 @@
Summary: KDE PIM Libraries
Url: http://www.kde.org
Version: 4.1.3
-Release: 5
+Release: 6
Source0: kdepimlibs-%version.tar.bz2
Source1: _upstream
Patch0: 4_1_BRANCH.diff
Patch1: r884779-nntp-msg-id.diff
Patch2: kdepimlibs_external_libical.diff
Patch3: r879190-kcal-timezones-crash.diff
+Patch4: r892407-idmapper-robustness.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: libkdepimlibs4 = %version
Requires: kdelibs4 >= %( echo `rpm -q --queryformat '%{VERSION}'
libkde4-devel`)
@@ -51,6 +52,7 @@
%patch1
%patch2
%patch3
+%patch4
rm -rf kcal/libical

%build
@@ -196,6 +198,8 @@
%_kde_share_dir/config.kcfg/mailtransport.kcfg

%changelog
+* Thu Dec 04 2008 wstephenson@xxxxxxx
+- Fix korganizer crash on corrupt uidmap file (bnc#441363)
* Tue Dec 02 2008 wstephenson@xxxxxxx
- Backport patch to fix crash on korgac startup (bnc#450659)
* Sat Nov 29 2008 dmueller@xxxxxxx

++++++ r892407-idmapper-robustness.diff ++++++
Subject: Add robustness to KRES::IdMapper
From: wstephenson@xxxxxxxxxx
Bug: bnc#441363
Patch-Upstream: r892407
Index: kresources/tests/idmappertest.cpp
===================================================================
--- kresources/tests/idmappertest.cpp (revision 892406)
+++ kresources/tests/idmappertest.cpp (revision 892407)
@@ -36,6 +36,7 @@
mapper.setRemoteId( "foo", "bar" );
mapper.setRemoteId( "yes", "klar" );
mapper.setRemoteId( "no", "nee" );
+ mapper.setRemoteId( QString(), QString() );

QString mapperAsString = "foo\tbar\t\r\nno\tnee\t\r\nyes\tklar\t\r\n";

Index: kresources/idmapper.cpp
===================================================================
--- kresources/idmapper.cpp (revision 892406)
+++ kresources/idmapper.cpp (revision 892407)
@@ -115,8 +115,12 @@
while ( !ts.atEnd() ) {
line = ts.readLine( 1024 );
QStringList parts = line.split( "\x02\x02", QString::KeepEmptyParts );
- d->idMap.insert( parts[ 0 ], parts[ 1 ] );
- d->fingerprintMap.insert( parts[ 0 ], parts[ 2 ] );
+ // sanity check; the uidmap file could be corrupted and
+ // QList doesn't like accessing invalid indexes
+ if ( parts.count() == 3 ) {
+ d->idMap.insert( parts[ 0 ], parts[ 1 ] );
+ d->fingerprintMap.insert( parts[ 0 ], parts[ 2 ] );
+ }
}

file.close();
@@ -157,17 +161,21 @@

void IdMapper::setRemoteId( const QString &localId, const QString &remoteId )
{
- d->idMap.insert( localId, remoteId );
+ if ( !( localId.isEmpty() || remoteId.isEmpty() ) ) {
+ d->idMap.insert( localId, remoteId );
+ }
}

void IdMapper::removeRemoteId( const QString &remoteId )
{
- QMap<QString, QVariant>::Iterator it;
- for ( it = d->idMap.begin(); it != d->idMap.end(); ++it ) {
- if ( it.value().toString() == remoteId ) {
- d->idMap.remove( it.key() );
- d->fingerprintMap.remove( it.key() );
- return;
+ if ( !remoteId.isEmpty( ) ) {
+ QMap<QString, QVariant>::Iterator it;
+ for ( it = d->idMap.begin(); it != d->idMap.end(); ++it ) {
+ if ( it.value().toString() == remoteId ) {
+ d->idMap.remove( it.key() );
+ d->fingerprintMap.remove( it.key() );
+ return;
+ }
}
}
}
@@ -214,7 +222,9 @@

void IdMapper::setFingerprint( const QString &localId, const QString
&fingerprint )
{
- d->fingerprintMap.insert( localId, fingerprint );
+ if ( !( localId.isEmpty() || fingerprint.isEmpty() ) ) {
+ d->fingerprintMap.insert( localId, fingerprint );
+ }
}

QString IdMapper::fingerprint( const QString &localId ) const

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread