[git] GPGME - branch, master, updated. gpgme-1.8.0-95-g43aa3ee

by Andre Heinecke cvs at cvs.gnupg.org
Mon Mar 13 11:23:33 CET 2017


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  43aa3eed15dcc4f848915ceabeff35c29c1c57e4 (commit)
       via  9d5048d47446450a34cae4f27eb81c02ea5d4afc (commit)
      from  d2240a2a1819874929bdab820bcbd3bee7f94407 (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 43aa3eed15dcc4f848915ceabeff35c29c1c57e4
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Mar 13 11:16:41 2017 +0100

    qt: Add test for DN parser
    
    * qt/tests/t-various.cpp (testDN): New.
    
    --
    A simple test for the DN parser that would have caught
    the new / free mismatch fixed in 9d5048d4.

diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp
index b4ba9f2..2b51fe6 100644
--- a/lang/qt/tests/t-various.cpp
+++ b/lang/qt/tests/t-various.cpp
@@ -42,6 +42,7 @@
 #include "keylistresult.h"
 #include "context.h"
 #include "engineinfo.h"
+#include "dn.h"
 
 #include "t-support.h"
 
@@ -56,6 +57,15 @@ Q_SIGNALS:
     void asyncDone();
 
 private Q_SLOTS:
+    void testDN()
+    {
+        DN dn(QStringLiteral("CN=Before\\0DAfter,OU=Test,DC=North America,DC=Fabrikam,DC=COM"));
+        QVERIFY(dn.dn() == QStringLiteral("CN=Before\rAfter,OU=Test,DC=North America,DC=Fabrikam,DC=COM"));
+        QStringList attrOrder;
+        attrOrder << QStringLiteral("DC") << QStringLiteral("OU") << QStringLiteral("CN");
+        dn.setAttributeOrder(attrOrder);
+        QVERIFY(dn.prettyDN() == QStringLiteral("DC=North America,DC=Fabrikam,DC=COM,OU=Test,CN=Before\rAfter"));
+    }
 
     void testQuickUid()
     {

commit 9d5048d47446450a34cae4f27eb81c02ea5d4afc
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Mar 13 11:14:54 2017 +0100

    qt: Use gpgrt_asprintf instead of qstrdup
    
    * lang/qt/src/dn.cpp (parse_dn_part): Use gpgrt_asprintf instead
    of qstrdup.
    
    --
    This fixes a new / free mismatch because qstrdup uses new and
    the allocated parts are freed with free. Similar to: a09ed3f2

diff --git a/lang/qt/src/dn.cpp b/lang/qt/src/dn.cpp
index 3376aef..f9fb2f6 100644
--- a/lang/qt/src/dn.cpp
+++ b/lang/qt/src/dn.cpp
@@ -37,7 +37,7 @@
 
 #include "dn.h"
 
-#include <strings.h>
+#include <gpg-error.h>
 
 static const struct {
     const char *name;
@@ -167,7 +167,7 @@ parse_dn_part(DnPair *array, const unsigned char *string)
     for (unsigned int i = 0; i < numOidMaps; ++i)
         if (!strcasecmp((char *)p, oidmap[i].oid)) {
             free(p);
-            p = qstrdup(oidmap[i].name);
+            gpgrt_asprintf(&p, oidmap[i].name);
             break;
         }
     array->key = p;

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

Summary of changes:
 lang/qt/src/dn.cpp          |  4 ++--
 lang/qt/tests/t-various.cpp | 10 ++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)


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




More information about the Gnupg-commits mailing list