[git] GnuPG - branch, master, updated. gnupg-2.1.9-195-g686f31c

by Werner Koch cvs at cvs.gnupg.org
Fri Nov 27 18:37:15 CET 2015


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  686f31c3d5aee0d2825265869ae92ca95cdcabae (commit)
       via  436a154ea85e4dffbde7c3b316fbfca1b066aa2a (commit)
       via  7c856f99144b84ac30e0c9a192f09dc36d93190a (commit)
       via  501436ab0f9d8e7d56b2f5e344006be5f5a3c653 (commit)
       via  022342e2845834ec35269d23491e9fa573d5c028 (commit)
       via  64e87083394d38998feab359caac917bcc6139d3 (commit)
       via  100f34e869df899a695f5e5ef1b8e092baf91751 (commit)
       via  6501741d2c1beb8060198a39a1aa950cb11b386f (commit)
      from  da5a232199ef93be219e933a7eaf4ccfc6d24d61 (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 686f31c3d5aee0d2825265869ae92ca95cdcabae
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 18:23:33 2015 +0100

    gpg: Avoid extra translation strings.
    
    * g10/keyedit.c (menu_expire): Use only one prompt.
    --
    
    The old code was anyway not fully i18n because it did not used
    ngettext.  Further we ran into const char*/char* conflicts on Windows
    where we use a different gettext implementation.
    
    FWIW: A better pattern in the case of a static and a malloced string
    w/o error return on malloc failure would be:
    
      const char *s;
      char *s_buf;
      s_buf = xtryasprintf ("%d foo", n);
      if (!s_buf)
        s = "several foo";
      else
        s = s_buf;
      bar (s);
      xfree (s_buf);

diff --git a/g10/keyedit.c b/g10/keyedit.c
index 9cf6f44..d7c70e6 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -4003,22 +4003,10 @@ menu_expire (KBNODE pub_keyblock)
   n1 = count_selected_keys (pub_keyblock);
   if (n1 > 1)
     {
-      char *s = xtryasprintf (_("Are you sure you want to change the"
-                                " expiration time %d subkeys? (y/N) "), n1);
-      int s_need_free;
-      if (s)
-        s_need_free = 0;
-      else
-        {
-          s = _("Are you sure you want to change the"
-                " expiration time for multiple subkeys? (y/N) ");
-          s_need_free = 0;
-        }
-
-      rc = cpr_get_answer_is_yes ("keyedit.expire_multiple_subkeys.okay", s);
-      if (s_need_free)
-        xfree (s);
-      if (! rc)
+      if (!cpr_get_answer_is_yes
+          ("keyedit.expire_multiple_subkeys.okay",
+           _("Are you sure you want to change the"
+             " expiration time for multiple subkeys? (y/N) ")))
 	return 0;
     }
   else if (n1)

commit 436a154ea85e4dffbde7c3b316fbfca1b066aa2a
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 18:10:31 2015 +0100

    kbx: Include gpg-error prior to mischelp.h.
    
    * kbx/keybox-init.c: Change order of includes.
    --
    
    This is to avoid redefintion warnings about GPGRT_ATTR_PRINTF.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/kbx/keybox-init.c b/kbx/keybox-init.c
index 618966f..e91911c 100644
--- a/kbx/keybox-init.c
+++ b/kbx/keybox-init.c
@@ -24,8 +24,8 @@
 #include <unistd.h>
 #include <assert.h>
 
-#include "../common/mischelp.h"
 #include "keybox-defs.h"
+#include "../common/mischelp.h"
 
 static KB_NAME kb_names;
 

commit 7c856f99144b84ac30e0c9a192f09dc36d93190a
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 17:59:52 2015 +0100

    gpg,w32: Fix a format string error.
    
    * g10/keyring.c (keyring_search): Fix format string for off_t.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/keyring.c b/g10/keyring.c
index 5ebea99..cf67eb0 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -1216,8 +1216,8 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
         goto real_found;
 
       if (DBG_LOOKUP)
-        log_debug ("%s: packet starting at offset %zx matched descriptor %zd\n",
-                   __func__, offset, n);
+        log_debug ("%s: packet starting at offset %lld matched descriptor %zu\n"
+                   , __func__, (long long)offset, n);
 
       /* Record which desc we matched on.  Note this value is only
 	 meaningful if this function returns with no errors. */

commit 501436ab0f9d8e7d56b2f5e344006be5f5a3c653
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 17:58:51 2015 +0100

    Silence compiler warnings related to not using assuan_fd_t.
    
    * common/call-gpg.c (start_gpg): Use assuan_fd_t.  Note that the
    declaration was already fixed by a previous change.
    * dirmngr/server.c (cmd_getinfo): Use assuan_fd_t.
    --
    
    Note that this matters only for Windows and it does not harm as long
    as we can only build for 32 bit Windows withsizeof(int)==sizeof(void*).
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/call-gpg.c b/common/call-gpg.c
index 4a32c88..cd865ef 100644
--- a/common/call-gpg.c
+++ b/common/call-gpg.c
@@ -47,7 +47,7 @@ start_gpg (ctrl_t ctrl, const char *gpg_program, strlist_t gpg_arguments,
   assuan_context_t ctx = NULL;
   const char *pgmname;
   const char **argv;
-  int no_close_list[5];
+  assuan_fd_t no_close_list[5];
   int i;
   char line[ASSUAN_LINELENGTH];
 
@@ -100,7 +100,7 @@ start_gpg (ctrl_t ctrl, const char *gpg_program, strlist_t gpg_arguments,
     no_close_list[i++] = assuan_fd_from_posix_fd (input_fd);
   if (output_fd != -1)
     no_close_list[i++] = assuan_fd_from_posix_fd (output_fd);
-  no_close_list[i] = -1;
+  no_close_list[i] = ASSUAN_INVALID_FD;
 
   /* Connect to GPG and perform initial handshaking.  */
   err = assuan_pipe_connect (ctx, gpg_program, argv, no_close_list,
diff --git a/dirmngr/server.c b/dirmngr/server.c
index 536354c..32c265b 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -2126,8 +2126,8 @@ cmd_getinfo (assuan_context_t ctx, char *line)
 #if ASSUAN_VERSION_NUMBER >= 0x020402
           /* Check whether we can connect to the proxy.  We use a
              special feature introduced with libassuan 2.4.2.  */
-          int sock = assuan_sock_connect_byname (NULL, 0, 0, NULL,
-                                                 ASSUAN_SOCK_TOR);
+          assuan_fd_t sock = assuan_sock_connect_byname (NULL, 0, 0, NULL,
+                                                         ASSUAN_SOCK_TOR);
           if (sock == ASSUAN_INVALID_FD)
             {
               err = assuan_write_status

commit 022342e2845834ec35269d23491e9fa573d5c028
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 17:53:52 2015 +0100

    Silence unused variable or parameter warnings.
    
    --

diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index 4de897a..33e3ec3 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -717,6 +717,8 @@ setup_qualitybar (ctrl_t ctrl)
   char *tmpstr, *tmpstr2;
   const char *tooltip;
 
+  (void)ctrl;
+
   /* TRANSLATORS: This string is displayed by Pinentry as the label
      for the quality bar.  */
   tmpstr = try_percent_escape (L_("Quality:"), "\t\r\n\f\v");
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 3a5abbb..04b03d3 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1178,7 +1178,9 @@ main (int argc, char **argv )
       gnupg_fd_t fd_extra = GNUPG_INVALID_FD;
       gnupg_fd_t fd_browser = GNUPG_INVALID_FD;
       gnupg_fd_t fd_ssh = GNUPG_INVALID_FD;
+#ifndef HAVE_W32_SYSTEM
       pid_t pid;
+#endif
 
       /* Remove the DISPLAY variable so that a pinentry does not
          default to a specific display.  There is still a default
@@ -1237,7 +1239,6 @@ main (int argc, char **argv )
 #ifdef HAVE_W32_SYSTEM
       (void)csh_style;
       (void)nodetach;
-      pid = getpid ();
 #else /*!HAVE_W32_SYSTEM*/
       pid = fork ();
       if (pid == (pid_t)-1)
diff --git a/common/iobuf.c b/common/iobuf.c
index d49de96..e8b4a03 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -267,6 +267,7 @@ direct_open (const char *fname, const char *mode, int mode700)
   unsigned long da, cd, sm;
   HANDLE hfile;
 
+  (void)mode700;
   /* Note, that we do not handle all mode combinations */
 
   /* According to the ReactOS source it seems that open() of the
@@ -2271,8 +2272,6 @@ iobuf_set_limit (iobuf_t a, off_t nlimit)
 off_t
 iobuf_get_filelength (iobuf_t a, int *overflow)
 {
-  struct stat st;
-
   if (overflow)
     *overflow = 0;
 
@@ -2330,11 +2329,15 @@ iobuf_get_filelength (iobuf_t a, int *overflow)
       }
     log_error ("GetFileSize for handle %p failed: %s\n",
 	       fp, w32_strerror (0));
-#else
-    if ( !fstat (FD2INT (fp), &st) )
-      return st.st_size;
-    log_error("fstat() failed: %s\n", strerror(errno) );
-#endif
+#else /*!HAVE_W32_SYSTEM*/
+    {
+      struct stat st;
+
+      if ( !fstat (FD2INT (fp), &st) )
+        return st.st_size;
+      log_error("fstat() failed: %s\n", strerror(errno) );
+    }
+#endif /*!HAVE_W32_SYSTEM*/
   }
 
   return 0;
diff --git a/common/w32-afunix.h b/common/w32-afunix.h
index f6282a3..7025a49 100644
--- a/common/w32-afunix.h
+++ b/common/w32-afunix.h
@@ -38,7 +38,7 @@
 #include <unistd.h>
 
 /* We can easiliy replace this code by the socket wrappers from libassuan.  */
-#warning Please do not use this module anymore
+#warning Remove this code; it is only used on w32 by symcryptrun.
 
 #define DIRSEP_C '\\'
 
diff --git a/g10/keylist.c b/g10/keylist.c
index 031612c..58c0a96 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -870,7 +870,7 @@ list_keyblock_pka (ctrl_t ctrl, kbnode_t keyblock)
   char pkstrbuf[PUBKEY_STRING_SIZE];
   char *hexfpr;
   char *hexkeyblock = NULL;
-  unsigned int hexkeyblocklen;
+  unsigned int hexkeyblocklen = 0;  /* Init to avoid -Wmaybe-uninitialized. */
   const char *s;
 
   /* Get the keyid from the keyblock.  */
diff --git a/g10/trustdb.c b/g10/trustdb.c
index 386796c..fbb806d 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -992,9 +992,16 @@ tdb_get_validity_core (PKT_public_key *pk, PKT_user_id *uid,
   TRUSTREC trec, vrec;
   gpg_error_t err;
   ulong recno;
+#ifdef USE_TOFU
   unsigned int tofu_validity = TRUST_UNKNOWN;
+#endif
   unsigned int validity = TRUST_UNKNOWN;
 
+#ifndef USE_TOFU
+  (void)sig;
+  (void)may_ask;
+#endif
+
   init_trustdb ();
 
   /* If we have no trustdb (which also means it has not been created)

commit 64e87083394d38998feab359caac917bcc6139d3
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 18:30:14 2015 +0100

    Avoid incompatible pointer assignment warnings on Windows.
    
    * common/logging.c (fun_writer): Use gpgrt_ssize_t instead of ssize_t.
    * dirmngr/server.c (data_line_cookie_write): Ditto.
    * sm/certdump.c (format_name_writer): Ditto.
    * sm/server.c (data_line_cookie_write): Ditto.
    * dirmngr/http.c (cookie_read, cookie_write): Ditto.
    --
    
    See the release notes of libgpg-error 1.15 for background info on
    gpgrt_ssize_t.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/logging.c b/common/logging.c
index 54b8c89..b7f1419 100644
--- a/common/logging.c
+++ b/common/logging.c
@@ -195,7 +195,7 @@ parse_portno (const char *str, unsigned short *r_port)
 }
 
 
-static ssize_t
+static gpgrt_ssize_t
 fun_writer (void *cookie_arg, const void *buffer, size_t size)
 {
   struct fun_cookie_s *cookie = cookie_arg;
@@ -391,11 +391,11 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size)
           DWORD nwritten;
 
           WriteFile ((HANDLE)cookie->fd, buffer, size, &nwritten, NULL);
-          return (ssize_t)size; /* Okay.  */
+          return (gpgrt_ssize_t)size; /* Okay.  */
         }
 #endif
       if (!writen (cookie->fd, buffer, size, cookie->is_socket))
-        return (ssize_t)size; /* Okay. */
+        return (gpgrt_ssize_t)size; /* Okay. */
     }
 
   if (!running_detached && cookie->fd != -1
@@ -415,7 +415,7 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size)
       log_socket = -1;
     }
 
-  return (ssize_t)size;
+  return (gpgrt_ssize_t)size;
 }
 
 
diff --git a/dirmngr/http.c b/dirmngr/http.c
index 02854e4..d623f7e 100644
--- a/dirmngr/http.c
+++ b/dirmngr/http.c
@@ -169,8 +169,9 @@ static assuan_fd_t connect_server (const char *server, unsigned short port,
                                    int *r_host_not_found);
 static gpg_error_t write_server (int sock, const char *data, size_t length);
 
-static ssize_t cookie_read (void *cookie, void *buffer, size_t size);
-static ssize_t cookie_write (void *cookie, const void *buffer, size_t size);
+static gpgrt_ssize_t cookie_read (void *cookie, void *buffer, size_t size);
+static gpgrt_ssize_t cookie_write (void *cookie,
+                                   const void *buffer, size_t size);
 static int cookie_close (void *cookie);
 
 
@@ -2415,7 +2416,7 @@ write_server (int sock, const char *data, size_t length)
 
 

 /* Read handler for estream.  */
-static ssize_t
+static gpgrt_ssize_t
 cookie_read (void *cookie, void *buffer, size_t size)
 {
   cookie_t c = cookie;
@@ -2497,11 +2498,11 @@ cookie_read (void *cookie, void *buffer, size_t size)
         c->content_length = 0;
     }
 
-  return nread;
+  return (gpgrt_ssize_t)nread;
 }
 
 /* Write handler for estream.  */
-static ssize_t
+static gpgrt_ssize_t
 cookie_write (void *cookie, const void *buffer_arg, size_t size)
 {
   const char *buffer = buffer_arg;
@@ -2550,7 +2551,7 @@ cookie_write (void *cookie, const void *buffer_arg, size_t size)
         nwritten = size;
     }
 
-  return nwritten;
+  return (gpgrt_ssize_t)nwritten;
 }
 
 
diff --git a/dirmngr/server.c b/dirmngr/server.c
index e08afd4..536354c 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -95,8 +95,8 @@ struct server_local_s
 
 
 /* Cookie definition for assuan data line output.  */
-static ssize_t data_line_cookie_write (void *cookie,
-                                       const void *buffer, size_t size);
+static gpgrt_ssize_t data_line_cookie_write (void *cookie,
+                                             const void *buffer, size_t size);
 static int data_line_cookie_close (void *cookie);
 static es_cookie_io_functions_t data_line_cookie_functions =
   {
@@ -210,14 +210,14 @@ data_line_write (assuan_context_t ctx, const void *buffer_arg, size_t size)
 
 /* A write handler used by es_fopencookie to write assuan data
    lines.  */
-static ssize_t
+static gpgrt_ssize_t
 data_line_cookie_write (void *cookie, const void *buffer, size_t size)
 {
   assuan_context_t ctx = cookie;
 
   if (data_line_write (ctx, buffer, size))
     return -1;
-  return (ssize_t)size;
+  return (gpgrt_ssize_t)size;
 }
 
 
diff --git a/sm/certdump.c b/sm/certdump.c
index f32a27c..0cc492a 100644
--- a/sm/certdump.c
+++ b/sm/certdump.c
@@ -652,7 +652,7 @@ struct format_name_cookie
 };
 
 /* The writer function for the memory stream. */
-static ssize_t
+static gpgrt_ssize_t
 format_name_writer (void *cookie, const void *buffer, size_t size)
 {
   struct format_name_cookie *c = cookie;
@@ -696,7 +696,7 @@ format_name_writer (void *cookie, const void *buffer, size_t size)
   c->len += size;
   p[c->len] = 0; /* Terminate string. */
 
-  return (ssize_t)size;
+  return (gpgrt_ssize_t)size;
 }
 
 
diff --git a/sm/server.c b/sm/server.c
index e47861b..f0512ef 100644
--- a/sm/server.c
+++ b/sm/server.c
@@ -55,8 +55,8 @@ struct server_local_s {
 
 
 /* Cookie definition for assuan data line output.  */
-static ssize_t data_line_cookie_write (void *cookie,
-                                       const void *buffer, size_t size);
+static gpgrt_ssize_t data_line_cookie_write (void *cookie,
+                                             const void *buffer, size_t size);
 static int data_line_cookie_close (void *cookie);
 static es_cookie_io_functions_t data_line_cookie_functions =
   {
@@ -129,7 +129,7 @@ has_option (const char *line, const char *name)
 
 /* A write handler used by es_fopencookie to write assuan data
    lines.  */
-static ssize_t
+static gpgrt_ssize_t
 data_line_cookie_write (void *cookie, const void *buffer, size_t size)
 {
   assuan_context_t ctx = cookie;
@@ -140,7 +140,7 @@ data_line_cookie_write (void *cookie, const void *buffer, size_t size)
       return -1;
     }
 
-  return size;
+  return (gpgrt_ssize_t)size;
 }
 
 static int

commit 100f34e869df899a695f5e5ef1b8e092baf91751
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 17:12:56 2015 +0100

    dirmngr: Avoid a declarations after statements.
    
    * tools/gpgtar.c (parse_arguments): Use a block for a local varibale
    definition.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/gpgtar.c b/tools/gpgtar.c
index a46a339..a09d2f0 100644
--- a/tools/gpgtar.c
+++ b/tools/gpgtar.c
@@ -347,38 +347,42 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
         case oCMS:     /* Dummy option for now.  */ break;
 
         case oGpgArgs:;
-          strlist_t list;
-          if (shell_parse_stringlist (pargs->r.ret_str, &list))
-            log_error ("failed to parse gpg arguments '%s'\n",
-                       pargs->r.ret_str);
-          else
-            {
-              if (opt.gpg_arguments)
-                strlist_last (opt.gpg_arguments)->next = list;
-              else
-                opt.gpg_arguments = list;
-            }
+          {
+            strlist_t list;
+            if (shell_parse_stringlist (pargs->r.ret_str, &list))
+              log_error ("failed to parse gpg arguments '%s'\n",
+                         pargs->r.ret_str);
+            else
+              {
+                if (opt.gpg_arguments)
+                  strlist_last (opt.gpg_arguments)->next = list;
+                else
+                  opt.gpg_arguments = list;
+              }
+          }
           break;
 
         case oTarArgs:;
-          int tar_argc;
-          char **tar_argv;
-
-          if (shell_parse_argv (pargs->r.ret_str, &tar_argc, &tar_argv))
-            log_error ("failed to parse tar arguments '%s'\n",
-                       pargs->r.ret_str);
-          else
-            {
-              ARGPARSE_ARGS tar_args;
-              tar_args.argc = &tar_argc;
-              tar_args.argv = &tar_argv;
-              tar_args.flags = ARGPARSE_FLAG_ARG0;
-              parse_arguments (&tar_args, tar_opts);
-              if (tar_args.err)
-                log_error ("unsupported tar arguments '%s'\n",
-                           pargs->r.ret_str);
-              pargs->err = tar_args.err;
-            }
+          {
+            int tar_argc;
+            char **tar_argv;
+
+            if (shell_parse_argv (pargs->r.ret_str, &tar_argc, &tar_argv))
+              log_error ("failed to parse tar arguments '%s'\n",
+                         pargs->r.ret_str);
+            else
+              {
+                ARGPARSE_ARGS tar_args;
+                tar_args.argc = &tar_argc;
+                tar_args.argv = &tar_argv;
+                tar_args.flags = ARGPARSE_FLAG_ARG0;
+                parse_arguments (&tar_args, tar_opts);
+                if (tar_args.err)
+                  log_error ("unsupported tar arguments '%s'\n",
+                             pargs->r.ret_str);
+                pargs->err = tar_args.err;
+              }
+          }
           break;
 
         case oDryRun:

commit 6501741d2c1beb8060198a39a1aa950cb11b386f
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 27 17:10:59 2015 +0100

    dirmngr: Avoid casting away a const from an char**.
    
    * dirmngr/ldap.c (start_cert_fetch_ldap): Do not use pointers from
    global variables.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/dirmngr/ldap.c b/dirmngr/ldap.c
index 1fe8a81..20cbbd8 100644
--- a/dirmngr/ldap.c
+++ b/dirmngr/ldap.c
@@ -520,33 +520,54 @@ start_cert_fetch_ldap (ctrl_t ctrl, cert_fetch_context_t *context,
                        strlist_t patterns, const ldap_server_t server)
 {
   gpg_error_t err;
-  const char *host;
+  char *proxy = NULL;
+  char *host = NULL;
   int port;
-  const char *user;
-  const char *pass;
+  char *user = NULL;
+  char *pass = NULL;
   const char *base;
   char *argv[50];
-  int argc;
-  int argc_malloced;
+  int argc = 0;
+  int argc_malloced = 0;
   char portbuf[30], timeoutbuf[30];
 
 
   *context = NULL;
+
+  if (opt.ldap_proxy && !(proxy = xtrystrdup (opt.ldap_proxy)))
+    {
+      err = gpg_error_from_syserror ();
+      goto leave;
+    }
+
   if (server)
     {
-      host = server->host;
+      if (server->host && !(host = xtrystrdup (server->host)))
+        {
+          err = gpg_error_from_syserror ();
+          goto leave;
+        }
       port = server->port;
-      user = server->user;
-      pass = server->pass;
+      if (server->user && !(user = xtrystrdup (server->user)))
+        {
+          err = gpg_error_from_syserror ();
+          goto leave;
+        }
+      if (server->pass && !(pass = xtrystrdup (server->pass)))
+        {
+          err = gpg_error_from_syserror ();
+          goto leave;
+        }
       base = server->base;
+
     }
   else /* Use a default server. */
     return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
 
+
   if (!base)
     base = "";
 
-  argc = 0;
   if (pass) /* Note: Must be the first item. */
     {
       argv[argc++] = "--pass";
@@ -558,14 +579,14 @@ start_cert_fetch_ldap (ctrl_t ctrl, cert_fetch_context_t *context,
   argv[argc++] = "--multi";
   if (opt.ldaptimeout)
     {
-      sprintf (timeoutbuf, "%u", opt.ldaptimeout);
+      snprintf (timeoutbuf, sizeof timeoutbuf, "%u", opt.ldaptimeout);
       argv[argc++] = "--timeout";
       argv[argc++] = timeoutbuf;
     }
   if (opt.ldap_proxy)
     {
       argv[argc++] = "--proxy";
-      argv[argc++] = opt.ldap_proxy;
+      argv[argc++] = proxy;
     }
   if (host)
     {
@@ -574,7 +595,7 @@ start_cert_fetch_ldap (ctrl_t ctrl, cert_fetch_context_t *context,
     }
   if (port)
     {
-      sprintf (portbuf, "%d", port);
+      snprintf (portbuf, sizeof portbuf, "%d", port);
       argv[argc++] = "--port";
       argv[argc++] = portbuf;
     }
@@ -626,7 +647,7 @@ start_cert_fetch_ldap (ctrl_t ctrl, cert_fetch_context_t *context,
       goto leave;
     }
 
-  err = ldap_wrapper (ctrl, &(*context)->reader, argv);
+  err = ldap_wrapper (ctrl, &(*context)->reader, (const char**)argv);
 
   if (err)
     {
@@ -637,6 +658,10 @@ start_cert_fetch_ldap (ctrl_t ctrl, cert_fetch_context_t *context,
  leave:
   for (; argc_malloced < argc; argc_malloced++)
     xfree (argv[argc_malloced]);
+  xfree (proxy);
+  xfree (host);
+  xfree (user);
+  xfree (pass);
   return err;
 }
 

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

Summary of changes:
 agent/call-pinentry.c |  2 ++
 agent/gpg-agent.c     |  3 ++-
 common/call-gpg.c     |  4 ++--
 common/iobuf.c        | 17 ++++++++------
 common/logging.c      |  8 +++----
 common/w32-afunix.h   |  2 +-
 dirmngr/http.c        | 13 ++++++-----
 dirmngr/ldap.c        | 51 +++++++++++++++++++++++++++++++-----------
 dirmngr/server.c      | 12 +++++-----
 g10/keyedit.c         | 20 ++++-------------
 g10/keylist.c         |  2 +-
 g10/keyring.c         |  4 ++--
 g10/trustdb.c         |  7 ++++++
 kbx/keybox-init.c     |  2 +-
 sm/certdump.c         |  4 ++--
 sm/server.c           |  8 +++----
 tools/gpgtar.c        | 62 +++++++++++++++++++++++++++------------------------
 17 files changed, 126 insertions(+), 95 deletions(-)


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




More information about the Gnupg-commits mailing list