Hello community, here is the log from the commit of package karchive for openSUSE:Factory checked in at 2016-10-28 12:16:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/karchive (Old) and /work/SRC/openSUSE:Factory/.karchive.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "karchive" Changes: -------- --- /work/SRC/openSUSE:Factory/karchive/karchive.changes 2016-09-14 23:10:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.karchive.new/karchive.changes 2016-10-28 12:16:53.000000000 +0200 @@ -1,0 +2,15 @@ +Sun Oct 2 12:49:55 UTC 2016 - [email protected] + +- Update to 5.27.0 + * Fix memory leak with KTar's KCompressionDevice + * KArchive: fix memory leak when an entry with the + same name already exists + * Fix memory leak in KZip when handling empty directories + * K7Zip: Fix memory leaks on error + * Fix memory leak detected by ASAN when open() fails + on the underlying device + * Remove bad cast to KFilterDev, detected by ASAN + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.27.0.php + +------------------------------------------------------------------- Old: ---- karchive-5.26.0.tar.xz New: ---- karchive-5.27.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ karchive.spec ++++++ --- /var/tmp/diff_new_pack.K0w4Oo/_old 2016-10-28 12:16:55.000000000 +0200 +++ /var/tmp/diff_new_pack.K0w4Oo/_new 2016-10-28 12:16:55.000000000 +0200 @@ -17,9 +17,9 @@ %define lname libKF5Archive5 -%define _tar_path 5.26 +%define _tar_path 5.27 Name: karchive -Version: 5.26.0 +Version: 5.27.0 Release: 0 BuildRequires: cmake >= 2.8.12 BuildRequires: extra-cmake-modules >= %{_tar_path} ++++++ karchive-5.26.0.tar.xz -> karchive-5.27.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/CMakeLists.txt new/karchive-5.27.0/CMakeLists.txt --- old/karchive-5.26.0/CMakeLists.txt 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/CMakeLists.txt 2016-10-02 09:46:21.000000000 +0200 @@ -3,7 +3,7 @@ project(KArchive) include(FeatureSummary) -find_package(ECM 5.26.0 NO_MODULE) +find_package(ECM 5.27.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) @@ -49,7 +49,7 @@ include(ECMSetupVersion) include(ECMGenerateHeaders) -set(KF5_VERSION "5.26.0") # handled by release scripts +set(KF5_VERSION "5.27.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KARCHIVE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/autotests/karchivetest.cpp new/karchive-5.27.0/autotests/karchivetest.cpp --- old/karchive-5.26.0/autotests/karchivetest.cpp 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/autotests/karchivetest.cpp 2016-10-02 09:46:21.000000000 +0200 @@ -773,7 +773,8 @@ const KArchiveDirectory *dir = tar.directory(); QTemporaryDir tmpDir; - const QString dirName = tmpDir.path() + '/'; + const QString dirName = tmpDir.path() + "/subdir"; // use a subdir so /tmp/foo doesn't break the test :) + QDir().mkdir(dirName); QVERIFY(dir->copyTo(dirName)); QVERIFY(!QFile::exists(dirName + "../foo")); @@ -829,18 +830,7 @@ // Otherwise we just lose data. KZip zip(QDir::currentPath()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) // 523440a15f in QSaveFile makes it fail for existing directories, as one would expect. QVERIFY(!zip.open(QIODevice::WriteOnly)); -#else - QVERIFY(zip.open(QIODevice::WriteOnly)); - - writeTestFilesToArchive(&zip); - - // try to add something as a file that is no file - QVERIFY(!zip.addLocalFile(QDir::currentPath(), "bogusdir")); - - QVERIFY(!zip.close()); -#endif } void KArchiveTest::testReadZipError() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/src/k7zip.cpp new/karchive-5.27.0/src/k7zip.cpp --- old/karchive-5.26.0/src/k7zip.cpp 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/src/k7zip.cpp 2016-10-02 09:46:21.000000000 +0200 @@ -1647,6 +1647,8 @@ result = filter->uncompress(); if (result == KFilterBase::Error) { qDebug() << " decode error"; + filter->terminate(); + delete filter; return QByteArray(); } int uncompressedBytes = outBuffer.size() - filter->outBufferAvailable(); @@ -1662,6 +1664,7 @@ if (result != KFilterBase::End && !filter->inBufferEmpty()) { qDebug() << "decode failed result" << result; + filter->terminate(); delete filter; return QByteArray(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/src/karchive.cpp new/karchive-5.27.0/src/karchive.cpp --- old/karchive-5.26.0/src/karchive.cpp 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/src/karchive.cpp 2016-10-02 09:46:21.000000000 +0200 @@ -795,13 +795,10 @@ void KArchiveDirectory::addEntry(KArchiveEntry *entry) { - if (entry->name().isEmpty()) { - return; - } - if (d->entries.value(entry->name())) { /*qWarning() << "directory " << name() << "has entry" << entry->name() << "already";*/ + delete entry; return; } d->entries.insert(entry->name(), entry); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/src/karchivedirectory.h new/karchive-5.27.0/src/karchivedirectory.h --- old/karchive-5.26.0/src/karchivedirectory.h 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/src/karchivedirectory.h 2016-10-02 09:46:21.000000000 +0200 @@ -90,8 +90,9 @@ /** * @internal * Adds a new entry to the directory. + * Note: this can delete the entry if another one with the same name is already present */ - void addEntry(KArchiveEntry *); + void addEntry(KArchiveEntry *); // KF6 TODO: return bool /** * @internal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/src/kcompressiondevice.cpp new/karchive-5.27.0/src/kcompressiondevice.cpp --- old/karchive-5.26.0/src/kcompressiondevice.cpp 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/src/kcompressiondevice.cpp 2016-10-02 09:46:21.000000000 +0200 @@ -128,6 +128,7 @@ //qWarning() << "KCompressionDevice::open: device is already open"; return true; // QFile returns false, but well, the device -is- open... } + d->bOpenedUnderlyingDevice = false; //qDebug() << mode; if (mode == QIODevice::ReadOnly) { d->buffer.resize(0); @@ -135,22 +136,21 @@ d->buffer.resize(BUFFER_SIZE); d->filter->setOutBuffer(d->buffer.data(), d->buffer.size()); } + if (!d->filter->device()->isOpen()) { + if (!d->filter->device()->open(mode)) { + //qWarning() << "KCompressionDevice::open: Couldn't open underlying device"; + return false; + } + d->bOpenedUnderlyingDevice = true; + } d->bNeedHeader = !d->bSkipHeaders; d->filter->setFilterFlags(d->bSkipHeaders ? KFilterBase::NoHeaders : KFilterBase::WithHeaders); if (!d->filter->init(mode)) { return false; } - d->bOpenedUnderlyingDevice = !d->filter->device()->isOpen(); - bool ret = d->bOpenedUnderlyingDevice ? d->filter->device()->open(mode) : true; d->result = KFilterBase::Ok; - - if (!ret) { - //qWarning() << "KCompressionDevice::open: Couldn't open underlying device"; - } else { - setOpenMode(mode); - } - - return ret; + setOpenMode(mode); + return true; } void KCompressionDevice::close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/src/ktar.cpp new/karchive-5.27.0/src/ktar.cpp --- old/karchive-5.26.0/src/ktar.cpp 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/src/ktar.cpp 2016-10-02 09:46:21.000000000 +0200 @@ -49,6 +49,7 @@ : q(parent) , tarEnd(0) , tmpFile(0) + , compressionDevice(Q_NULLPTR) { } @@ -58,6 +59,7 @@ QTemporaryFile *tmpFile; QString mimetype; QByteArray origFileName; + KCompressionDevice *compressionDevice; bool fillTempFile(const QString &fileName); bool writeBackTempFile(const QString &fileName); @@ -133,8 +135,8 @@ // Create a compression filter on top of the QSaveFile device that KArchive created. //qDebug() << "creating KFilterDev for" << d->mimetype; KCompressionDevice::CompressionType type = KFilterDev::compressionTypeForMimeType(d->mimetype); - KCompressionDevice *compressionDevice = new KCompressionDevice(device(), true, type); - setDevice(compressionDevice); + d->compressionDevice = new KCompressionDevice(device(), false, type); + setDevice(d->compressionDevice); } return true; } else { @@ -167,6 +169,7 @@ } delete d->tmpFile; + delete d->compressionDevice; delete d; } @@ -383,6 +386,9 @@ if (n == 0x200) { bool isdir = false; + if (name.isEmpty()) { + continue; + } if (name.endsWith(QLatin1Char('/'))) { isdir = true; name.truncate(name.length() - 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.26.0/src/kzip.cpp new/karchive-5.27.0/src/kzip.cpp --- old/karchive-5.26.0/src/kzip.cpp 2016-09-06 00:14:42.000000000 +0200 +++ new/karchive-5.27.0/src/kzip.cpp 2016-10-02 09:46:21.000000000 +0200 @@ -1182,12 +1182,13 @@ } KCompressionDevice::CompressionType type = KFilterDev::compressionTypeForMimeType(QStringLiteral("application/x-gzip")); - d->m_currentDev = new KCompressionDevice(device(), false, type); + auto compressionDevice = new KCompressionDevice(device(), false, type); + d->m_currentDev = compressionDevice; Q_ASSERT(d->m_currentDev); if (!d->m_currentDev) { return false; // ouch } - static_cast<KFilterDev *>(d->m_currentDev)->setSkipHeaders(); // Just zlib, not gzip + compressionDevice->setSkipHeaders(); // Just zlib, not gzip b = d->m_currentDev->open(QIODevice::WriteOnly); Q_ASSERT(b);
