[git] GPGME - branch, master, updated. gpgme-1.12.0-19-g174af15

by Werner Koch cvs at cvs.gnupg.org
Thu Oct 18 17:00:00 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  174af15725d4989a840ff3098996cc8a0568f724 (commit)
      from  9de1c96ac3cf6fa126325002b61a1b606037ca88 (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 174af15725d4989a840ff3098996cc8a0568f724
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 18 16:50:18 2018 +0200

    core: Return an error if NULL is provided for genkey's parms.
    
    * src/debug.c (_gpgme_debug_buffer): Bail out of BUF is NULL.
    * src/genkey.c (gpgme_op_genkey): Do no deref a NULL in
    TRACE_LOGBUF.
    (gpgme_op_genkey_start): Ditto. Return an error if PARMS is NULL.
    --
    
    This robustness patch should solve one part of
    GnuPG-bug-id: 4192
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/debug.c b/src/debug.c
index d7604a7..37baabb 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -379,6 +379,9 @@ _gpgme_debug_buffer (int lvl, const char *const fmt,
   if (!_gpgme_debug_trace ())
     return;
 
+  if (!buffer)
+    return;
+
   while (idx < len)
     {
       char str[51];
diff --git a/src/genkey.c b/src/genkey.c
index ffca7e8..0108aab 100644
--- a/src/genkey.c
+++ b/src/genkey.c
@@ -283,9 +283,9 @@ gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms,
 
   TRACE_BEG2 (DEBUG_CTX, "gpgme_op_genkey_start", ctx,
 	      "pubkey=%p, seckey=%p", pubkey, seckey);
-  TRACE_LOGBUF (parms, strlen (parms));
+  TRACE_LOGBUF (parms, parms? strlen (parms):0);
 
-  if (!ctx)
+  if (!ctx || parms)
     return TRACE_ERR (gpg_error (GPG_ERR_INV_ARG));
 
   err = genkey_start (ctx, 0, parms, pubkey, seckey);
@@ -304,7 +304,7 @@ gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms, gpgme_data_t pubkey,
 
   TRACE_BEG2 (DEBUG_CTX, "gpgme_op_genkey", ctx,
 	      "pubkey=%p, seckey=%p", pubkey, seckey);
-  TRACE_LOGBUF (parms, strlen (parms));
+  TRACE_LOGBUF (parms, parms? strlen (parms):0);
 
   if (!ctx)
     return TRACE_ERR (gpg_error (GPG_ERR_INV_ARG));

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

Summary of changes:
 src/debug.c  | 3 +++
 src/genkey.c | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list