[git] GnuPG - branch, master, updated. gnupg-2.1.20-122-gabe3a90

by Andre Heinecke cvs at cvs.gnupg.org
Mon May 15 12:50:50 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  abe3a9043f86b48b92ddcec47197e032e35a6f4f (commit)
      from  00b7767bc6fe309aa20375c859ebf708cfc7b9ea (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 abe3a9043f86b48b92ddcec47197e032e35a6f4f
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Apr 26 09:39:06 2017 +0200

    dirmngr,w32: Fix ldap crl read on windows
    
    Summary:
    * dirmngr/ldap-wrapper-ce.c (outstream_cookie_s): Add buffer_read_pos.
    (buffer_get_data): Use seperate read pos.
    
    --
    Using a single buffer pos for reading and writing caused the read
    to return 0 as it read from the end of the buffer. Now we use
    a seperate reader position.
    
    Differential: D427
    
    Signed-off-by: Andre Heinecke <aheinecke at intevation.de>

diff --git a/dirmngr/ldap-wrapper-ce.c b/dirmngr/ldap-wrapper-ce.c
index 1e42189..01f8f64 100644
--- a/dirmngr/ldap-wrapper-ce.c
+++ b/dirmngr/ldap-wrapper-ce.c
@@ -117,6 +117,7 @@ struct outstream_cookie_s
   char buffer[4000];  /* Data ring buffer.  */
   size_t buffer_len;  /* The amount of data in the BUFFER.  */
   size_t buffer_pos;  /* The next read position of the BUFFER.  */
+  size_t buffer_read_pos;  /* The next read position of the BUFFER.  */
 };
 
 #define BUFFER_EMPTY(c) ((c)->buffer_len == 0)
@@ -125,6 +126,8 @@ struct outstream_cookie_s
 #define BUFFER_SPACE_AVAILABLE(c) (DIM((c)->buffer) - (c)->buffer_len)
 #define BUFFER_INC_POS(c,n) (c)->buffer_pos = ((c)->buffer_pos + (n)) % DIM((c)->buffer)
 #define BUFFER_CUR_POS(c) (&(c)->buffer[(c)->buffer_pos])
+#define BUFFER_INC_READ_POS(c,n) (c)->buffer_read_pos = ((c)->buffer_read_pos + (n)) % DIM((c)->buffer)
+#define BUFFER_CUR_READ_POS(c) (&(c)->buffer[(c)->buffer_read_pos])
 
 static int
 buffer_get_data (struct outstream_cookie_s *cookie, char *dst, int cnt)
@@ -143,15 +146,15 @@ buffer_get_data (struct outstream_cookie_s *cookie, char *dst, int cnt)
   if (chunk > left)
     chunk = left;
 
-  memcpy (dst, BUFFER_CUR_POS (cookie), chunk);
-  BUFFER_INC_POS (cookie, chunk);
+  memcpy (dst, BUFFER_CUR_READ_POS (cookie), chunk);
+  BUFFER_INC_READ_POS (cookie, chunk);
   left -= chunk;
   dst += chunk;
 
   if (left)
     {
-      memcpy (dst, BUFFER_CUR_POS (cookie), left);
-      BUFFER_INC_POS (cookie, left);
+      memcpy (dst, BUFFER_CUR_READ_POS (cookie), left);
+      BUFFER_INC_READ_POS (cookie, left);
     }
 
   return amount;

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

Summary of changes:
 dirmngr/ldap-wrapper-ce.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)


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




More information about the Gnupg-commits mailing list