From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DE4B2158042 for ; Wed, 6 Nov 2024 19:52:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A5CF9E0E08; Wed, 6 Nov 2024 19:52:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8632AE0E08 for ; Wed, 6 Nov 2024 19:52:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 92891342FA7 for ; Wed, 6 Nov 2024 19:52:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id EE5321CBF for ; Wed, 6 Nov 2024 19:52:13 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1730922704.dd1d07066b493b813c2005138328f78f2194532c.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/ghostwriter/, app-editors/ghostwriter/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-editors/ghostwriter/files/ghostwriter-24.08.2-fix-segfault.patch app-editors/ghostwriter/ghostwriter-24.08.2-r1.ebuild X-VCS-Directories: app-editors/ghostwriter/files/ app-editors/ghostwriter/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: dd1d07066b493b813c2005138328f78f2194532c X-VCS-Branch: master Date: Wed, 6 Nov 2024 19:52:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: aa19560e-4272-4a0b-9281-cc39dc864950 X-Archives-Hash: 5f5826128e4c305ba4358efd93b5aaf8 commit: dd1d07066b493b813c2005138328f78f2194532c Author: Andreas Sturmlechner gentoo org> AuthorDate: Wed Nov 6 19:46:03 2024 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Wed Nov 6 19:51:44 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd1d0706 app-editors/ghostwriter: Fix segfaults See also: https://invent.kde.org/office/ghostwriter/-/merge_requests/46 KDE-bug: https://bugs.kde.org/show_bug.cgi?id=465799 Closes: https://bugs.gentoo.org/942928 Signed-off-by: Andreas Sturmlechner gentoo.org> .../files/ghostwriter-24.08.2-fix-segfault.patch | 175 +++++++++++++++++++++ .../ghostwriter/ghostwriter-24.08.2-r1.ebuild | 44 ++++++ 2 files changed, 219 insertions(+) diff --git a/app-editors/ghostwriter/files/ghostwriter-24.08.2-fix-segfault.patch b/app-editors/ghostwriter/files/ghostwriter-24.08.2-fix-segfault.patch new file mode 100644 index 000000000000..5466e47a319e --- /dev/null +++ b/app-editors/ghostwriter/files/ghostwriter-24.08.2-fix-segfault.patch @@ -0,0 +1,175 @@ +From bfca43e551729b9518772fed6fba19bb5dbe6646 Mon Sep 17 00:00:00 2001 +From: Megan Conkle +Date: Sat, 12 Oct 2024 23:34:27 -0700 +Subject: [PATCH] Fix segmentation fault when .conf file is missing + +Whenever ghostwriter.conf is missing (or the last used exporter within +is empty), the app will crash with a segmentation fault due to accessing +an uninitialed pointer to the current HTML exporter in appsettings.cpp. +This commit ensures that the pointer is initialized to null before being +checked for whether obtaining an exporter was successful. +BUG: 465799 + +(cherry picked from commit f82070ac7916b36bb0bfd84a5c0e96cb084a6e28) +Signed-off-by: Andreas Sturmlechner +--- + CHANGELOG.md | 8 ++++++++ + src/preview/htmlpreview.cpp | 24 ++++++++++++------------ + src/settings/appsettings.cpp | 18 ++++++++++++------ + 3 files changed, 32 insertions(+), 18 deletions(-) + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index 6f34002f..89017211 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 + + ## [Unreleased] + ++## [24.08.3] ++ ++### Fixed ++ ++* Issue #465799: Segmentation fault no longer occurs when .conf file is missing on first launch. ++ ++## [24.08.0] ++ + ### Added + + * Added more icons to menu actions. +diff --git a/src/preview/htmlpreview.cpp b/src/preview/htmlpreview.cpp +index db89dd29..5a600769 100644 +--- a/src/preview/htmlpreview.cpp ++++ b/src/preview/htmlpreview.cpp +@@ -1,5 +1,5 @@ +-/* +- * SPDX-FileCopyrightText: 2014-2023 Megan Conkle ++/* ++ * SPDX-FileCopyrightText: 2014-2024 Megan Conkle + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ +@@ -38,7 +38,7 @@ public: + HtmlPreviewPrivate(HtmlPreview *q_ptr) + : q_ptr(q_ptr) + { +- ; ++ proxy = new PreviewProxy(q_ptr); + } + + ~HtmlPreviewPrivate() +@@ -51,7 +51,7 @@ public: + MarkdownDocument *document; + bool updateInProgress; + bool updateAgain; +- PreviewProxy proxy; ++ PreviewProxy *proxy; + QString baseUrl; + QRegularExpression headingTagExp; + Exporter *exporter; +@@ -91,7 +91,7 @@ HtmlPreview::HtmlPreview + d->updateInProgress = false; + d->updateAgain = false; + d->exporter = exporter; +- d->proxy.setMathEnabled(d->exporter->supportsMath()); ++ d->proxy->setMathEnabled(d->exporter->supportsMath()); + + d->baseUrl = ""; + +@@ -153,7 +153,7 @@ HtmlPreview::HtmlPreview + this->setZoomFactor((horizontalDpi / 96.0)); + + QWebChannel *channel = new QWebChannel(this); +- channel->registerObject(QStringLiteral("previewProxy"), &d->proxy); ++ channel->registerObject(QStringLiteral("previewProxy"), d->proxy); + this->page()->setWebChannel(channel); + + QFile wrapperHtmlFile(":/resources/preview.html"); +@@ -240,22 +240,22 @@ void HtmlPreview::setHtmlExporter(Exporter *exporter) + + d->exporter = exporter; + d->setHtmlContent(""); +- d->proxy.setMathEnabled(d->exporter->supportsMath()); ++ d->proxy->setMathEnabled(d->exporter->supportsMath()); + updatePreview(); + } + + void HtmlPreview::setStyleSheet(const QString &css) + { + Q_D(HtmlPreview); +- +- d->proxy.setStyleSheet(css); ++ ++ d->proxy->setStyleSheet(css); + } + + void HtmlPreview::setMathEnabled(bool enabled) + { + Q_D(HtmlPreview); +- +- d->proxy.setMathEnabled(enabled); ++ ++ d->proxy->setMathEnabled(enabled); + } + + void HtmlPreviewPrivate::onHtmlReady() +@@ -312,7 +312,7 @@ void HtmlPreview::closeEvent(QCloseEvent *event) + + void HtmlPreviewPrivate::setHtmlContent(const QString &html) + { +- this->proxy.setHtmlContent(html); ++ this->proxy->setHtmlContent(html); + } + + QString HtmlPreviewPrivate::exportToHtml +diff --git a/src/settings/appsettings.cpp b/src/settings/appsettings.cpp +index a76c25a5..7d51ac5d 100644 +--- a/src/settings/appsettings.cpp ++++ b/src/settings/appsettings.cpp +@@ -65,6 +65,7 @@ public: + static AppSettings *instance; + + AppSettingsPrivate() ++ : currentHtmlExporter(nullptr) + { + ; + } +@@ -677,6 +678,7 @@ void AppSettings::setShowUnbreakableSpaceEnabled(bool enabled) + d->showUnbreakableSpaceEnabled = enabled; + emit showUnbreakableSpaceEnabledChanged(d->showUnbreakableSpaceEnabled); + } ++ + AppSettings::AppSettings() + : d_ptr(new AppSettingsPrivate()) + { +@@ -843,17 +845,21 @@ AppSettings::AppSettings() + + QString exporterName = appSettings.value(constants::GW_LAST_USED_EXPORTER_KEY).toString(); + ++ d->currentHtmlExporter = nullptr; ++ + if (!exporterName.isEmpty()) { + d->currentHtmlExporter = ExporterFactory::instance()->exporterByName(exporterName); +- } + +- if (d->currentHtmlExporter) { +- auto lastExportOptions = appSettings.value(constants::GW_LAST_USED_EXPORTER_PARAMS_KEY).toString(); ++ if (d->currentHtmlExporter) { ++ auto lastExportOptions = appSettings.value(constants::GW_LAST_USED_EXPORTER_PARAMS_KEY).toString(); + +- if (!lastExportOptions.isEmpty()) { +- d->currentHtmlExporter->setOptions(lastExportOptions); ++ if (!lastExportOptions.isEmpty()) { ++ d->currentHtmlExporter->setOptions(lastExportOptions); ++ } + } +- } else { ++ } ++ ++ if (!d->currentHtmlExporter) { + d->currentHtmlExporter = ExporterFactory::instance()->htmlExporters().first(); + } + } +-- +GitLab + diff --git a/app-editors/ghostwriter/ghostwriter-24.08.2-r1.ebuild b/app-editors/ghostwriter/ghostwriter-24.08.2-r1.ebuild new file mode 100644 index 000000000000..85e2aa731416 --- /dev/null +++ b/app-editors/ghostwriter/ghostwriter-24.08.2-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +KDE_ORG_CATEGORY="office" +ECM_HANDBOOK="optional" +KFMIN=6.5.0 +QTMIN=6.7.2 +inherit ecm gear.kde.org + +DESCRIPTION="Cross-platform, aesthetic, distraction-free markdown editor" +HOMEPAGE="https://ghostwriter.kde.org/" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~arm64" +IUSE="" + +RDEPEND=" + app-text/hunspell:= + >=dev-qt/qtbase-${QTMIN}:6[gui,widgets] + >=dev-qt/qtsvg-${QTMIN}:6 + >=dev-qt/qtwebchannel-${QTMIN}:6 + >=dev-qt/qtwebengine-${QTMIN}:6 + >=kde-frameworks/kcoreaddons-${KFMIN}:6 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:6 + >=kde-frameworks/kxmlgui-${KFMIN}:6 + >=kde-frameworks/sonnet-${KFMIN}:6 + virtual/opengl +" +DEPEND="${RDEPEND} + >=dev-qt/qtbase-${QTMIN}:6[concurrent] +" +BDEPEND=" + >=dev-qt/qttools-${QTMIN}:6[linguist] + virtual/pkgconfig +" + +DOCS=( CHANGELOG.md README.md ) + +# Picked for 24.08.3, hopefully to be respun: +# https://invent.kde.org/office/ghostwriter/-/merge_requests/46 +PATCHES=( "${FILESDIR}/${P}-fix-segfault.patch" ) # bug 942928