[neon/kf6/kf6-kservice/Neon/release] debian/patches: Revert "backport recommended patch to not be so crashy"
Carlos De Maine
null at kde.org
Tue Mar 3 10:42:28 GMT 2026
Git commit 4225dcc28d65baa92757359c4ba6fca4aad14966 by Carlos De Maine.
Committed on 03/03/2026 at 10:42.
Pushed by carlosdem into branch 'Neon/release'.
Revert "backport recommended patch to not be so crashy"
This reverts commit 1e67e53538cf7ce3f3d1fdd746048f209b328b38
(cherry picked from commit 4677012b776824f7369f340e936f659361490dde)
Co-authored-by: Carlos De Maine <carlosd.kde at gmail.com>
D +0 -73 debian/patches/dont-crash.diff
D +0 -1 debian/patches/series
https://invent.kde.org/neon/kf6/kf6-kservice/-/commit/4225dcc28d65baa92757359c4ba6fca4aad14966
diff --git a/debian/patches/dont-crash.diff b/debian/patches/dont-crash.diff
deleted file mode 100644
index 951d205..0000000
--- a/debian/patches/dont-crash.diff
+++ /dev/null
@@ -1,73 +0,0 @@
-diff --git a/src/sycoca/ksycocafactory.cpp b/src/sycoca/ksycocafactory.cpp
-index 0100226bb253e2e26ee0745fb4206f6d457a80ce..7bb0d4826cbdc3a48d22d2705de02bd25248273b 100644
---- a/src/sycoca/ksycocafactory.cpp
-+++ b/src/sycoca/ksycocafactory.cpp
-@@ -34,27 +34,42 @@ public:
- int m_beginEntryOffset = 0;
- int m_endEntryOffset = 0;
- KSycocaDict *m_sycocaDict = nullptr;
-+ // Used to avoid crashes when the factory failed to locate an actual data stream.
-+ // Mind that we need a backing buffer since callers also tap into the stream's QIODevice.
-+ QByteArray m_fallbackBuffer;
-+ QDataStream m_fallbackStream{m_fallbackBuffer};
- };
-
- KSycocaFactory::KSycocaFactory(KSycocaFactoryId factory_id, KSycoca *sycoca)
- : m_sycoca(sycoca)
- , d(new KSycocaFactoryPrivate)
- {
-- if (!m_sycoca->isBuilding() && (m_str = m_sycoca->findFactory(factory_id))) {
-- // Read position of index tables....
-- qint32 i;
-- (*m_str) >> i;
-- d->m_sycocaDictOffset = i;
-- (*m_str) >> i;
-- d->m_beginEntryOffset = i;
-- (*m_str) >> i;
-- d->m_endEntryOffset = i;
--
-- QDataStream *str = stream();
-- qint64 saveOffset = str->device()->pos();
-- // Init index tables
-- d->m_sycocaDict = new KSycocaDict(str, d->m_sycocaDictOffset);
-- saveOffset = str->device()->seek(saveOffset);
-+ if (!m_sycoca->isBuilding()) {
-+ m_str = m_sycoca->findFactory(factory_id);
-+ if (m_str) {
-+ // Read position of index tables....
-+ qint32 i;
-+ (*m_str) >> i;
-+ d->m_sycocaDictOffset = i;
-+ (*m_str) >> i;
-+ d->m_beginEntryOffset = i;
-+ (*m_str) >> i;
-+ d->m_endEntryOffset = i;
-+
-+ QDataStream *str = stream();
-+ qint64 saveOffset = str->device()->pos();
-+ // Init index tables
-+ d->m_sycocaDict = new KSycocaDict(str, d->m_sycocaDictOffset);
-+ saveOffset = str->device()->seek(saveOffset);
-+ } else {
-+ qWarning() << "Could not find factory with id" << int(factory_id)
-+ << "in sycoca database, you must run kbuildsycoca first! Creating a fake stream to not crash.";
-+ m_str = &d->m_fallbackStream;
-+ m_entryDict = new KSycocaEntryDict;
-+ d->m_sycocaDict = new KSycocaDict;
-+ d->m_beginEntryOffset = 0;
-+ d->m_endEntryOffset = 0;
-+ }
- } else {
- // We are in kbuildsycoca -- build new database!
- m_entryDict = new KSycocaEntryDict;
-@@ -186,8 +201,8 @@ KSycocaEntry::List KSycocaFactory::allEntries() const
- qint32 entryCount;
- (*str) >> entryCount;
-
-- if (entryCount > 8192) {
-- qCWarning(SYCOCA) << QThread::currentThread() << "error detected in factory" << this;
-+ if (entryCount < 0 || entryCount > 8192) { // mind that new accepts a size_t (unsigned) but we are dealing with an int here
-+ qCWarning(SYCOCA) << QThread::currentThread() << "error detected in factory" << this << entryCount;
- KSycoca::flagError();
- return list;
- }
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 4701132..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-dont-crash.diff
More information about the Neon-commits
mailing list