[git] GnuPG - branch, master, updated. gnupg-2.1.19-98-g5e89144

by Justus Winter cvs at cvs.gnupg.org
Thu Mar 30 16:15:18 CEST 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 "The GNU Privacy Guard".

The branch, master has been updated
       via  5e89144cbca36c1e7eb814b3aad4b7c46cd4efbf (commit)
       via  214fa9012296d796b78f1a3106d656639cf50aef (commit)
      from  a6142dbdbc5783043deb847dc64998c421860941 (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 5e89144cbca36c1e7eb814b3aad4b7c46cd4efbf
Author: Justus Winter <justus at g10code.com>
Date:   Thu Mar 30 12:35:18 2017 +0200

    gpg: Consistent use of preprocessor conditionals.
    
    * g10/parse-packet.c: Use '#if' instead of '#ifdef' when checking
    DEBUG_PARSE_PACKET.  This fixes the build with '#define
    DEBUG_PARSE_PACKET 0'.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 793e198..ffed956 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -50,7 +50,7 @@ static estream_t listfp;
 
 static int parse (parse_packet_ctx_t ctx, PACKET *pkt, int onlykeypkts,
 		  off_t * retpos, int *skip, IOBUF out, int do_skip
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
 		  , const char *dbg_w, const char *dbg_f, int dbg_l
 #endif
   );
@@ -261,7 +261,7 @@ unknown_pubkey_warning (int algo)
 }
 
 
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
 int
 dbg_parse_packet (parse_packet_ctx_t ctx, PACKET *pkt,
                   const char *dbg_f, int dbg_l)
@@ -295,7 +295,7 @@ parse_packet (parse_packet_ctx_t ctx, PACKET *pkt)
  * Like parse packet, but only return secret or public (sub)key
  * packets.
  */
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
 int
 dbg_search_packet (parse_packet_ctx_t ctx, PACKET *pkt,
                    off_t * retpos, int with_uid,
@@ -331,7 +331,7 @@ search_packet (parse_packet_ctx_t ctx, PACKET *pkt,
 /*
  * Copy all packets from INP to OUT, thereby removing unused spaces.
  */
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
 int
 dbg_copy_all_packets (iobuf_t inp, iobuf_t out, const char *dbg_f, int dbg_l)
 {
@@ -388,7 +388,7 @@ copy_all_packets (iobuf_t inp, iobuf_t out)
  * Stop at offset STOPoff (i.e. don't copy packets at this or later
  * offsets)
  */
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
 int
 dbg_copy_some_packets (iobuf_t inp, iobuf_t out, off_t stopoff,
 		       const char *dbg_f, int dbg_l)
@@ -448,7 +448,7 @@ copy_some_packets (iobuf_t inp, iobuf_t out, off_t stopoff)
 /*
  * Skip over N packets
  */
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
 int
 dbg_skip_some_packets (iobuf_t inp, unsigned n, const char *dbg_f, int dbg_l)
 {
@@ -524,7 +524,7 @@ skip_some_packets (iobuf_t inp, unsigned int n)
 static int
 parse (parse_packet_ctx_t ctx, PACKET *pkt, int onlykeypkts, off_t * retpos,
        int *skip, IOBUF out, int do_skip
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
        , const char *dbg_w, const char *dbg_f, int dbg_l
 #endif
        )
@@ -747,7 +747,7 @@ parse (parse_packet_ctx_t ctx, PACKET *pkt, int onlykeypkts, off_t * retpos,
 
   if (DBG_PACKET)
     {
-#ifdef DEBUG_PARSE_PACKET
+#if DEBUG_PARSE_PACKET
       log_debug ("parse_packet(iob=%d): type=%d length=%lu%s (%s.%s.%d)\n",
 		 iobuf_id (inp), pkttype, pktlen, new_ctb ? " (new_ctb)" : "",
 		 dbg_w, dbg_f, dbg_l);

commit 214fa9012296d796b78f1a3106d656639cf50aef
Author: Justus Winter <justus at g10code.com>
Date:   Thu Mar 30 15:44:35 2017 +0200

    common: Avoid undefined behavior.
    
    * common/iobuf.c (iobuf_read_line): Do not consider 'length' if
    'buffer' is NULL.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/common/iobuf.c b/common/iobuf.c
index db66a7f..5a9fd7c 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -2552,7 +2552,7 @@ iobuf_read_line (iobuf_t a, byte ** addr_of_buffer,
      NUL character in the buffer.  This requires at least 2 bytes.  We
      don't complicate the code by handling the stupid corner case, but
      simply assert that it can't happen.  */
-  assert (length >= 2 || maxlen >= 2);
+  assert (!buffer || length >= 2 || maxlen >= 2);
 
   if (!buffer || length <= 1)
     /* must allocate a new buffer */

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

Summary of changes:
 common/iobuf.c     |  2 +-
 g10/parse-packet.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list