[Pkg-kde-bugs-fwd] [Bug 104454] crash when displaying meta info of file being downloaded

David Faure 104454@bugs.kde.org
17 Jun 2005 17:29:37 -0000


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=104454         




------- Additional Comments From faure kde org  2005-06-17 19:29 -------
SVN commit 426558 by dfaure:

Fix KTar crash, e.g. when displaying the tooltip for a .deb file.
tmpFile wasn't initialized to 0 in both constructors(!)

CCBUG: 104454
In fact this fixes the initial report in 104454, but the valgrind trace
there is very interesting for debugging #96405...


 M  +4 -5      ktar.cpp  


--- branches/KDE/3.4/kdelibs/kio/kio/ktar.cpp #426557:426558
 @ -45,7 +45,7  @
 class KTar::KTarPrivate
 {
 public:
-    KTarPrivate() : tarEnd( 0 ) {}
+    KTarPrivate() : tarEnd( 0 ), tmpFile( 0 ) {}
     QStringList dirList;
     int tarEnd;
     KTempFile* tmpFile;
 @ -57,12 +57,10  @
 };
 
 KTar::KTar( const QString& filename, const QString & _mimetype )
-    : KArchive( 0L )
+    : KArchive( 0 )
 {
     m_filename = filename;
     d = new KTarPrivate;
-    d->tmpFile = 0L;
-    d->mimetype = _mimetype;
     QString mimetype( _mimetype );
     bool forced = true;
     if ( mimetype.isEmpty() ) // Find out mimetype manually
 @ -107,8 +105,8  @
             file.close();
         }
         forced = false;
+    }
         d->mimetype = mimetype;
-    } // END mimetype.isEmpty()
 
     prepareDevice( filename, mimetype, forced );
 }
 @ -144,6 +142,7  @
 KTar::KTar( QIODevice * dev )
     : KArchive( dev )
 {
+    Q_ASSERT( dev );
     d = new KTarPrivate;
 }