Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2:Rings:1-MinimalX
pinentry
pinentry-qt-Fix-use-of-dangling-pointer.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pinentry-qt-Fix-use-of-dangling-pointer.patch of Package pinentry
From 0e2e53c8987d6f236aaef515eb005e8e86397fbc Mon Sep 17 00:00:00 2001 From: Andre Heinecke <aheinecke@gnupg.org> Date: Thu, 25 Jul 2019 14:20:51 +0200 Subject: [PATCH 1/1] qt: Fix use of dangling pointer in QApplication * qt/main.cpp (main): Use a new variable for argc that stays valid. -- The QApplication constructor takes argc as a reference and the referenced integer has to stay alive for at least as long as the QApplication. GnuPG-Bug-Id: T4658 Based on a Patch from: Fabian Vogt <fvogt@suse.com> Thanks! --- qt/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qt/main.cpp b/qt/main.cpp index fe88d26..4e61dff 100644 --- a/qt/main.cpp +++ b/qt/main.cpp @@ -330,6 +330,7 @@ main(int argc, char *argv[]) pinentry_init("pinentry-qt"); QApplication *app = NULL; + int new_argc = 0; #ifdef FALLBACK_CURSES if (!pinentry_have_display(argc, argv)) { @@ -369,8 +370,15 @@ main(int argc, char *argv[]) p += strlen(argv[i]) + 1; } - i = argc; - app = new QApplication(i, new_argv); + /* Note: QApplication uses int &argc so argc has to be valid + * for the full lifetime of the application. + * + * As Qt might modify argc / argv we use copies here so that + * we do not loose options that are handled in both. e.g. display. + */ + new_argc = argc; + Q_ASSERT (new_argc); + app = new QApplication(new_argc, new_argv); app->setWindowIcon(QIcon(QLatin1String(":/document-encrypt.png"))); } -- 2.11.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor