[git] GPGME - branch, master, updated. gpgme-1.11.1-110-g3b78244

by Andre Heinecke cvs at cvs.gnupg.org
Wed Aug 8 09:25:23 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  3b782443600e8091c5f19580cb218100bcbb4ad7 (commit)
      from  d09d19fa9fe1e81dd819b32208b4bd09f83e3918 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3b782443600e8091c5f19580cb218100bcbb4ad7
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Aug 8 09:22:46 2018 +0200

    cpp: Fix use after free in gencardkeyinteractor
    
    * lang/cpp/src/gpggencardkeyinteractor.cpp
    (GpgGenCardKeyInteractor::Private::keysize): Change to string.
    
    --
    The value is only required as string so we can save it this
    way to avoid the need to convert it for the action command.
    
    GnuPG-Bug-Id: T4094

diff --git a/lang/cpp/src/gpggencardkeyinteractor.cpp b/lang/cpp/src/gpggencardkeyinteractor.cpp
index 6f42e47..0ed6781 100644
--- a/lang/cpp/src/gpggencardkeyinteractor.cpp
+++ b/lang/cpp/src/gpggencardkeyinteractor.cpp
@@ -36,12 +36,11 @@ using namespace GpgME;
 class GpgGenCardKeyInteractor::Private
 {
 public:
-    Private() : keysize(2048), backup(false)
+    Private() : keysize("2048"), backup(false)
     {
 
     }
-    std::string name, email, backupFileName, expiry, serial;
-    int keysize;
+    std::string name, email, backupFileName, expiry, serial, keysize;
     bool backup;
 };
 
@@ -70,7 +69,7 @@ void GpgGenCardKeyInteractor::setDoBackup(bool value)
 
 void GpgGenCardKeyInteractor::setKeySize(int value)
 {
-    d->keysize = value;
+    d->keysize = std::to_string(value);
 }
 
 void GpgGenCardKeyInteractor::setExpiry(const std::string &timeStr)
@@ -132,7 +131,7 @@ const char *GpgGenCardKeyInteractor::action(Error &err) const
     case SIZE:
     case SIZE2:
     case SIZE3:
-        return std::to_string(d->keysize).c_str();
+        return d->keysize.c_str();
     case COMMENT:
         return "";
     case SAVE:

-----------------------------------------------------------------------

Summary of changes:
 lang/cpp/src/gpggencardkeyinteractor.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list