gnupg-2.0.9: bug in certchain.c...

Chuck Swiger cswiger at mac.com
Tue May 13 19:13:35 CEST 2008


Hi, all--

In gnupg-2.0.9, a local variable is being declared after a statement  
in a block rather than at the start, resulting in:

> [ ... ]

> source='certchain.c' object='certchain.o' libtool=no \
> 	DEPDIR=.deps depmode=gcc /bin/sh ../scripts/depcomp \
> 	cc -DHAVE_CONFIG_H -I. -I..  -I../gl -I../common -I../intl - 
> DLOCALEDIR=\"/usr/local/share/locale\" -DGNUPG_BINDIR="\"/usr/local/ 
> bin\"" -DGNUPG_LIBEXECDIR="\"/usr/local/libexec\"" - 
> DGNUPG_LIBDIR="\"/usr/local/lib/gnupg\"" -DGNUPG_DATADIR="\"/usr/ 
> local/share/gnupg\"" -DGNUPG_SYSCONFDIR="\"/usr/local/etc/gnupg 
> \""      -I/usr/local/include -I/usr/local/include -I/usr/local/ 
> include -I/usr/local/include  -O -pipe -march=pentium -Wall - 
> Wpointer-arith -c certchain.c
> certchain.c: In function `find_up':
> certchain.c:710: syntax error before `int'
> certchain.c:711: `old' undeclared (first use in this function)
> certchain.c:711: (Each undeclared identifier is reported only once
> certchain.c:711: for each function it appears in.)

A diff to fix this bug follows:

--- gnupg-2.0.9/sm/certchain.c~	Mon Feb 18 13:51:54 2008
+++ gnupg-2.0.9/sm/certchain.c	Tue May 13 13:00:36 2008
@@ -702,12 +702,13 @@
      rc = keydb_search_subject (kh, issuer);
    if (rc == -1 && !find_next)
      {
+      int old;
        /* Also try to get it from the Dirmngr cache.  The function
           merely puts it into the ephemeral database.  */
        find_up_dirmngr (ctrl, kh, NULL, issuer, 0);

        /* Not found, let us see whether we have one in the ephemeral  
key DB. */
-      int old = keydb_set_ephemeral (kh, 1);
+      old = keydb_set_ephemeral (kh, 1);
        if (!old)
          {
            keydb_search_reset (kh);

Regards,
-- 
-Chuck




More information about the Gnupg-devel mailing list