[git] GnuPG - branch, master, updated. gnupg-2.1.16-15-ga3b258d

by Justus Winter cvs at cvs.gnupg.org
Tue Nov 22 12:11:02 CET 2016


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  a3b258d1d15953816e0567511ecc527a4ccdd626 (commit)
       via  d8df80427238cdbb9ae0f6dae8bc7e9c24f6e265 (commit)
       via  7b4e2ea274ace22245264f1759279390d0300a62 (commit)
       via  66834eb838a8892d088f6b7332084a64d9f15008 (commit)
       via  893a3f7fb46021961914a8acdf1292a80e3eba93 (commit)
       via  6ce14a805f1da687dfb8535db57730d5c7403db7 (commit)
      from  037f9de09298a31026ea2ab5fbd4a599b11cc34f (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 a3b258d1d15953816e0567511ecc527a4ccdd626
Author: Justus Winter <justus at g10code.com>
Date:   Fri Nov 18 12:51:00 2016 +0100

    gpgscm: Refactor.
    
    * tests/gpgscm/scheme.c (opexe_0): Reduce code duplication.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 4a83cd5..e011dea 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -2963,16 +2963,16 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) {
                }
           }
 
-     CASE(OP_LAMBDA1):
-	  gc_disable(sc, 1);
-          s_return_enable_gc(sc, mk_closure(sc, sc->value, sc->envir));
-
 #else
      CASE(OP_LAMBDA):     /* lambda */
+	  sc->value = sc->code;
+	  /* Fallthrough. */
+#endif
+
+     CASE(OP_LAMBDA1):
 	  gc_disable(sc, 1);
-          s_return_enable_gc(sc, mk_closure(sc, sc->code, sc->envir));
+          s_return_enable_gc(sc, mk_closure(sc, sc->value, sc->envir));
 
-#endif
 
      CASE(OP_MKCLOSURE): /* make-closure */
        x=car(sc->args);

commit d8df80427238cdbb9ae0f6dae8bc7e9c24f6e265
Author: Justus Winter <justus at g10code.com>
Date:   Thu Nov 17 18:03:22 2016 +0100

    gpgscm: Fix property lists.
    
    * tests/gpgscm/opdefines.h (put, get): Check arguments.  Also rename
    to 'set-symbol-property' and 'symbol-property', the names used by
    Guile, because put and get are too unspecific.
    * tests/gpgscm/scheme.c (hasprop): Only symbols have property lists.
    (get_property): New function.
    (set_property): Likewise.
    (opexe_4): Use the new functions.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/opdefines.h b/tests/gpgscm/opdefines.h
index ceb4d0e..c7347fd 100644
--- a/tests/gpgscm/opdefines.h
+++ b/tests/gpgscm/opdefines.h
@@ -146,8 +146,8 @@
     _OP_DEF(opexe_4, "list*",                          1,  INF_ARG, TST_NONE,                        OP_LIST_STAR        )
     _OP_DEF(opexe_4, "append",                         0,  INF_ARG, TST_NONE,                        OP_APPEND           )
 #if USE_PLIST
-    _OP_DEF(opexe_4, "put",                            3,  3,       TST_NONE,                        OP_PUT              )
-    _OP_DEF(opexe_4, "get",                            2,  2,       TST_NONE,                        OP_GET              )
+    _OP_DEF(opexe_4, "set-symbol-property!",           3,  3,       TST_SYMBOL TST_SYMBOL TST_ANY,   OP_SET_SYMBOL_PROPERTY )
+    _OP_DEF(opexe_4, "symbol-property",                2,  2,       TST_SYMBOL TST_SYMBOL,           OP_SYMBOL_PROPERTY  )
 #endif
     _OP_DEF(opexe_4, "quit",                           0,  1,       TST_NUMBER,                      OP_QUIT             )
     _OP_DEF(opexe_4, "gc",                             0,  0,       0,                               OP_GC               )
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index a7d3fd7..4a83cd5 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -250,7 +250,7 @@ INTERFACE pointer set_cdr(pointer p, pointer q) { return cdr(p)=q; }
 INTERFACE INLINE int is_symbol(pointer p)   { return (type(p)==T_SYMBOL); }
 INTERFACE INLINE char *symname(pointer p)   { return strvalue(car(p)); }
 #if USE_PLIST
-SCHEME_EXPORT INLINE int hasprop(pointer p)     { return (typeflag(p)&T_SYMBOL); }
+SCHEME_EXPORT INLINE int hasprop(pointer p)     { return (is_symbol(p)); }
 #define symprop(p)       cdr(p)
 #endif
 
@@ -3380,6 +3380,52 @@ static pointer opexe_1(scheme *sc, enum scheme_opcodes op) {
      return sc->T;
 }
 
+#if USE_PLIST
+static pointer
+get_property(scheme *sc, pointer obj, pointer key)
+{
+  pointer x;
+
+  assert (is_symbol(obj));
+  assert (is_symbol(key));
+
+  for (x = symprop(obj); x != sc->NIL; x = cdr(x)) {
+    if (caar(x) == key)
+      break;
+  }
+
+  if (x != sc->NIL)
+    return cdar(x);
+
+  return sc->NIL;
+}
+
+static pointer
+set_property(scheme *sc, pointer obj, pointer key, pointer value)
+{
+#define set_property_allocates	2
+  pointer x;
+
+  assert (is_symbol(obj));
+  assert (is_symbol(key));
+
+  for (x = symprop(obj); x != sc->NIL; x = cdr(x)) {
+    if (caar(x) == key)
+      break;
+  }
+
+  if (x != sc->NIL)
+    cdar(x) = value;
+  else {
+    gc_disable(sc, gc_reservations(set_property));
+    symprop(obj) = cons(sc, cons(sc, key, value), symprop(obj));
+    gc_enable(sc);
+  }
+
+  return sc->T;
+}
+#endif
+
 static pointer opexe_2(scheme *sc, enum scheme_opcodes op) {
      pointer x;
      num v;
@@ -4127,36 +4173,14 @@ static pointer opexe_4(scheme *sc, enum scheme_opcodes op) {
           s_return(sc, reverse_in_place(sc, car(y), x));
 
 #if USE_PLIST
-     CASE(OP_PUT):        /* put */
-          if (!hasprop(car(sc->args)) || !hasprop(cadr(sc->args))) {
-               Error_0(sc,"illegal use of put");
-          }
-          for (x = symprop(car(sc->args)), y = cadr(sc->args); x != sc->NIL; x = cdr(x)) {
-               if (caar(x) == y) {
-                    break;
-               }
-          }
-          if (x != sc->NIL)
-               cdar(x) = caddr(sc->args);
-          else
-               symprop(car(sc->args)) = cons(sc, cons(sc, y, caddr(sc->args)),
-                                symprop(car(sc->args)));
-          s_return(sc,sc->T);
+     CASE(OP_SET_SYMBOL_PROPERTY): /* set-symbol-property! */
+	  gc_disable(sc, gc_reservations(set_property));
+          s_return_enable_gc(sc,
+			     set_property(sc, car(sc->args),
+					  cadr(sc->args), caddr(sc->args)));
 
-     CASE(OP_GET):        /* get */
-          if (!hasprop(car(sc->args)) || !hasprop(cadr(sc->args))) {
-               Error_0(sc,"illegal use of get");
-          }
-          for (x = symprop(car(sc->args)), y = cadr(sc->args); x != sc->NIL; x = cdr(x)) {
-               if (caar(x) == y) {
-                    break;
-               }
-          }
-          if (x != sc->NIL) {
-               s_return(sc,cdar(x));
-          } else {
-               s_return(sc,sc->NIL);
-          }
+     CASE(OP_SYMBOL_PROPERTY):  /* symbol-property */
+	  s_return(sc, get_property(sc, car(sc->args), cadr(sc->args)));
 #endif /* USE_PLIST */
      CASE(OP_QUIT):       /* quit */
           if(is_pair(sc->args)) {

commit 7b4e2ea274ace22245264f1759279390d0300a62
Author: Justus Winter <justus at g10code.com>
Date:   Thu Nov 17 15:47:26 2016 +0100

    gpgscm: Fix installation of error handler.
    
    * tests/gpgscm/ffi.scm: Set '*error-hook*' again so that the
    interpreter will use our function.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/ffi.scm b/tests/gpgscm/ffi.scm
index fb18538..c5f373c 100644
--- a/tests/gpgscm/ffi.scm
+++ b/tests/gpgscm/ffi.scm
@@ -61,6 +61,7 @@
     (_exit (cadr x)))
    (else
     (apply error x))))
+(set! *error-hook* throw)
 
 ;; Terminate the process returning STATUS to the parent.
 (define (exit status)

commit 66834eb838a8892d088f6b7332084a64d9f15008
Author: Justus Winter <justus at g10code.com>
Date:   Wed Nov 16 11:29:34 2016 +0100

    gpgscm: Use a static pool of cells for small integers.
    
    * tests/gpgscm/scheme-private.h (struct scheme): New fields for the
    static integer cells.
    * tests/gpgscm/scheme.c (_alloc_cellseg): New function.
    (alloc_cellseg): Use the new function.
    (MAX_SMALL_INTEGER): New macro.
    (initialize_small_integers): New function.
    (mk_small_integer): Likewise.
    (mk_integer): Return a small integer if possible.
    (_s_return): Do not free 'op' if it is a small integer.
    (s_save): Use a small integer to box the opcode.
    (scheme_init_custom_alloc): Initialize small integers.
    (scheme_deinit): Free chunk of small integers.
    * tests/gpgscm/scheme.h (USE_SMALL_INTEGERS): New macro.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/scheme-private.h b/tests/gpgscm/scheme-private.h
index aa78894..2c5c749 100644
--- a/tests/gpgscm/scheme-private.h
+++ b/tests/gpgscm/scheme-private.h
@@ -119,6 +119,12 @@ pointer SHARP_HOOK;  /* *sharp-hook* */
 pointer COMPILE_HOOK;  /* *compile-hook* */
 #endif
 
+#if USE_SMALL_INTEGERS
+/* A fixed allocation of small integers.  */
+void *integer_alloc;
+pointer integer_cells;
+#endif
+
 pointer free_cell;       /* pointer to top of free cells */
 long    fcells;          /* # of free cells */
 size_t  inhibit_gc;      /* nesting of gc_disable */
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index ee8992e..a7d3fd7 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -598,34 +598,47 @@ static long binary_decode(const char *s) {
  return x;
 }
 
+/* Allocate a new cell segment but do not make it available yet.  */
+static int
+_alloc_cellseg(scheme *sc, size_t len, void **alloc, pointer *cells)
+{
+  int adj = ADJ;
+  void *cp;
+
+  if (adj < sizeof(struct cell))
+    adj = sizeof(struct cell);
+
+  cp = sc->malloc(len * sizeof(struct cell) + adj);
+  if (cp == NULL)
+    return 1;
+
+  *alloc = cp;
+
+  /* adjust in TYPE_BITS-bit boundary */
+  if (((unsigned long) cp) % adj != 0)
+    cp = (void *) (adj * ((unsigned long) cp / adj + 1));
+
+  *cells = cp;
+  return 0;
+}
+
 /* allocate new cell segment */
 static int alloc_cellseg(scheme *sc, int n) {
      pointer newp;
      pointer last;
      pointer p;
-     void *cp;
      long i;
      int k;
-     int adj=ADJ;
-
-     if(adj<sizeof(struct cell)) {
-       adj=sizeof(struct cell);
-     }
 
      for (k = 0; k < n; k++) {
          if (sc->last_cell_seg >= CELL_NSEGMENT - 1)
               return k;
-         cp = sc->malloc(CELL_SEGSIZE * sizeof(struct cell)+adj);
-         if (cp == 0)
-              return k;
-         i = ++sc->last_cell_seg ;
-         sc->alloc_seg[i] = cp;
-         /* adjust in TYPE_BITS-bit boundary */
-         if(((unsigned long)cp)%adj!=0) {
-           cp=(void *)(adj*((unsigned long)cp/adj+1));
-         }
+	 i = ++sc->last_cell_seg;
+	 if (_alloc_cellseg(sc, CELL_SEGSIZE, &sc->alloc_seg[i], &newp)) {
+	      sc->last_cell_seg--;
+	      return k;
+	 }
          /* insert new segment in address order */
-         newp=(pointer)cp;
          sc->cell_seg[i] = newp;
          while (i > 0 && sc->cell_seg[i - 1] > sc->cell_seg[i]) {
              p = sc->cell_seg[i];
@@ -1128,16 +1141,64 @@ INTERFACE pointer mk_character(scheme *sc, int c) {
   return (x);
 }
 
+

+
+#if USE_SMALL_INTEGERS
+
+/* s_save assumes that all opcodes can be expressed as a small
+ * integer.  */
+#define MAX_SMALL_INTEGER	OP_MAXDEFINED
+
+static int
+initialize_small_integers(scheme *sc)
+{
+  int i;
+  if (_alloc_cellseg(sc, MAX_SMALL_INTEGER, &sc->integer_alloc,
+		     &sc->integer_cells))
+    return 1;
+
+  for (i = 0; i < MAX_SMALL_INTEGER; i++) {
+    pointer x = &sc->integer_cells[i];
+    typeflag(x) = T_NUMBER | T_ATOM | MARK;
+    ivalue_unchecked(x) = i;
+    set_num_integer(x);
+  }
+
+  return 0;
+}
+
+static INLINE pointer
+mk_small_integer(scheme *sc, long n)
+{
+#define mk_small_integer_allocates	0
+  assert(0 <= n && n < MAX_SMALL_INTEGER);
+  return &sc->integer_cells[n];
+}
+#else
+
+#define mk_small_integer_allocates	1
+#define mk_small_integer	mk_integer
+
+#endif
+
 /* get number atom (integer) */
 INTERFACE pointer mk_integer(scheme *sc, long n) {
-  pointer x = get_cell(sc,sc->NIL, sc->NIL);
+  pointer x;
+
+#if USE_SMALL_INTEGERS
+  if (0 <= n && n < MAX_SMALL_INTEGER)
+    return mk_small_integer(sc, n);
+#endif
 
+  x = get_cell(sc,sc->NIL, sc->NIL);
   typeflag(x) = (T_NUMBER | T_ATOM);
   ivalue_unchecked(x)= n;
   set_num_integer(x);
   return (x);
 }
 
+

+
 INTERFACE pointer mk_real(scheme *sc, double n) {
   pointer x = get_cell(sc,sc->NIL, sc->NIL);
 
@@ -2645,7 +2706,9 @@ static pointer _s_return(scheme *sc, pointer a, int enable_gc) {
     return sc->NIL;
   free_cons(sc, dump, &op, &dump);
   sc->op = ivalue(op);
+#ifndef USE_SMALL_INTEGERS
   free_cell(sc, op);
+#endif
   free_cons(sc, dump, &sc->args, &dump);
   free_cons(sc, dump, &sc->envir, &dump);
   free_cons(sc, dump, &sc->code, &sc->dump);
@@ -2653,12 +2716,12 @@ static pointer _s_return(scheme *sc, pointer a, int enable_gc) {
 }
 
 static void s_save(scheme *sc, enum scheme_opcodes op, pointer args, pointer code) {
-#define s_save_allocates	5
+#define s_save_allocates	(4 + mk_small_integer_allocates)
     pointer dump;
     gc_disable(sc, gc_reservations (s_save));
     dump = cons(sc, sc->envir, cons(sc, (code), sc->dump));
     dump = cons(sc, (args), dump);
-    sc->dump = cons(sc, mk_integer(sc, (long)(op)), dump);
+    sc->dump = cons(sc, mk_small_integer(sc, (long)(op)), dump);
     gc_enable(sc);
 }
 
@@ -4907,6 +4970,14 @@ int scheme_init_custom_alloc(scheme *sc, func_alloc malloc, func_dealloc free) {
   sc->T = &sc->_HASHT;
   sc->F = &sc->_HASHF;
   sc->EOF_OBJ=&sc->_EOF_OBJ;
+
+#if USE_SMALL_INTEGERS
+  if (initialize_small_integers(sc)) {
+    sc->no_memory=1;
+    return 0;
+  }
+#endif
+
   sc->free_cell = &sc->_NIL;
   sc->fcells = 0;
   sc->inhibit_gc = GC_ENABLED;
@@ -5052,6 +5123,10 @@ void scheme_deinit(scheme *sc) {
   sc->gc_verbose=0;
   gc(sc,sc->NIL,sc->NIL);
 
+#if USE_SMALL_INTEGERS
+  sc->free(sc->integer_alloc);
+#endif
+
   for(i=0; i<=sc->last_cell_seg; i++) {
     sc->free(sc->alloc_seg[i]);
   }
diff --git a/tests/gpgscm/scheme.h b/tests/gpgscm/scheme.h
index 8e93177..2b5b066 100644
--- a/tests/gpgscm/scheme.h
+++ b/tests/gpgscm/scheme.h
@@ -43,6 +43,7 @@ extern "C" {
 # define USE_COMPILE_HOOK 0
 # define USE_DL 0
 # define USE_PLIST 0
+# define USE_SMALL_INTEGERS 0
 #endif
 
 
@@ -95,6 +96,13 @@ extern "C" {
 # define USE_THREADED_CODE 1
 #endif
 
+/* Use a static set of cells to represent small numbers.  This set
+ * notably includes all opcodes, and hence saves a cell reservation
+ * during 's_save'.  */
+#ifndef USE_SMALL_INTEGERS
+# define USE_SMALL_INTEGERS 1
+#endif
+
 #ifndef USE_STRCASECMP   /* stricmp for Unix */
 # define USE_STRCASECMP 0
 #endif

commit 893a3f7fb46021961914a8acdf1292a80e3eba93
Author: Justus Winter <justus at g10code.com>
Date:   Thu Nov 17 11:48:38 2016 +0100

    tests: Delay querying the avaliable algorithms.
    
    * tests/openpgp/defs.scm: Set verbosity earlier, turn 'all-*-algos'
    into promises.
    * tests/openpgp/conventional-mdc.scm: Force the promises.
    * tests/openpgp/conventional.scm: Likewise.
    * tests/openpgp/encrypt-dsa.scm: Likewise.
    * tests/openpgp/encrypt.scm: Likewise.
    * tests/openpgp/gpgtar.scm: Likewise.
    * tests/openpgp/sigs.scm: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/conventional-mdc.scm b/tests/openpgp/conventional-mdc.scm
index fb92217..5b009ae 100755
--- a/tests/openpgp/conventional-mdc.scm
+++ b/tests/openpgp/conventional-mdc.scm
@@ -37,7 +37,7 @@
        (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
        (tr:assert-identity source)))
     '("plain-1" "data-80000")))
- all-cipher-algos)
+ (force all-cipher-algos))
 
 (for-each-p
  "Checking sign+symencrypt"
diff --git a/tests/openpgp/conventional.scm b/tests/openpgp/conventional.scm
index af889dc..612b992 100755
--- a/tests/openpgp/conventional.scm
+++ b/tests/openpgp/conventional.scm
@@ -46,4 +46,4 @@
        (tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
        (tr:assert-identity source)))
     '("plain-1" "data-80000")))
- all-cipher-algos)
+ (force all-cipher-algos))
diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
index e91902c..bdb86ca 100644
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -42,6 +42,10 @@
 (define data-files '("data-500" "data-9000" "data-32000" "data-80000"))
 (define exp-files '())
 
+(let ((verbose (string->number (getenv "verbose"))))
+  (if (number? verbose)
+      (*set-verbose!* verbose)))
+
 (define (qualify executable)
   (string-append executable (getenv "EXEEXT")))
 
@@ -95,16 +99,16 @@
 (define (get-config what)
   (string-split (caddar (gpg-with-colons `(--list-config ,what))) #\;))
 
-(define all-pubkey-algos (get-config "pubkeyname"))
-(define all-hash-algos (get-config "digestname"))
-(define all-cipher-algos (get-config "ciphername"))
+(define all-pubkey-algos (delay (get-config "pubkeyname")))
+(define all-hash-algos (delay (get-config "digestname")))
+(define all-cipher-algos (delay (get-config "ciphername")))
 
 (define (have-pubkey-algo? x)
-  (not (not (member x all-pubkey-algos))))
+  (not (not (member x (force all-pubkey-algos)))))
 (define (have-hash-algo? x)
-  (not (not (member x all-hash-algos))))
+  (not (not (member x (force all-hash-algos)))))
 (define (have-cipher-algo? x)
-  (not (not (member x all-cipher-algos))))
+  (not (not (member x (force all-cipher-algos)))))
 
 (define (gpg-pipe args0 args1 errfd)
   (lambda (source sink)
@@ -142,10 +146,6 @@
    (pipe:spawn `(, at GPG --dearmor))
    (pipe:write-to sink-name (logior O_WRONLY O_CREAT O_BINARY) #o600)))
 
-(let ((verbose (string->number (getenv "verbose"))))
-  (if (number? verbose)
-      (*set-verbose!* verbose)))
-
 ;;
 ;; Support for test environment creation and teardown.
 ;;
diff --git a/tests/openpgp/encrypt-dsa.scm b/tests/openpgp/encrypt-dsa.scm
index fccb8c9..7ac1916 100755
--- a/tests/openpgp/encrypt-dsa.scm
+++ b/tests/openpgp/encrypt-dsa.scm
@@ -43,4 +43,4 @@
        (tr:gpg "" '(--yes))
        (tr:assert-identity source)))
     (append plain-files data-files)))
- all-cipher-algos)
+ (force all-cipher-algos))
diff --git a/tests/openpgp/encrypt.scm b/tests/openpgp/encrypt.scm
index ea97b4d..4247aa8 100755
--- a/tests/openpgp/encrypt.scm
+++ b/tests/openpgp/encrypt.scm
@@ -43,7 +43,7 @@
        (tr:gpg "" '(--yes))
        (tr:assert-identity source)))
     (append plain-files data-files)))
- all-cipher-algos)
+ (force all-cipher-algos))
 
 
 ;; We encrypt to two keys and we have also put the first key into our
diff --git a/tests/openpgp/gpgtar.scm b/tests/openpgp/gpgtar.scm
index 69206b4..cd692de 100755
--- a/tests/openpgp/gpgtar.scm
+++ b/tests/openpgp/gpgtar.scm
@@ -84,7 +84,8 @@
 
     (info "Checking gpgtar with symmetric encryption and chosen cipher")
     (do-test `(, at ppflags --symmetric --gpg-args
-			 ,(string-append "--cipher=" (car all-cipher-algos)))
+			 ,(string-append "--cipher="
+					 (car (force all-cipher-algos))))
 	     ppflags (cons '--decrypt ppflags))
 
     (info "Checking gpgtar with both symmetric and asymmetric encryption")
diff --git a/tests/openpgp/sigs.scm b/tests/openpgp/sigs.scm
index abdcd8f..5a1efa7 100755
--- a/tests/openpgp/sigs.scm
+++ b/tests/openpgp/sigs.scm
@@ -48,4 +48,4 @@
 		`(--yes --sign --passphrase-fd "0" --digest-algo ,hash))
 	(tr:gpg "" '(--yes))
 	(tr:assert-identity (car plain-files)))))
- all-hash-algos)
+ (force all-hash-algos))

commit 6ce14a805f1da687dfb8535db57730d5c7403db7
Author: Justus Winter <justus at g10code.com>
Date:   Tue Nov 22 12:07:55 2016 +0100

    g10: Fix memory leak.
    
    * g10/tofu.c (tofu_notice_key_changed): Remove spurious duplicate call
    to 'hexfingerprint'.
    
    Fixes-commit: 037f9de09298a31026ea2ab5fbd4a599b11cc34f
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/tofu.c b/g10/tofu.c
index 9693893..6eb7f5e 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -3712,8 +3712,6 @@ tofu_notice_key_changed (ctrl_t ctrl, kbnode_t kb)
   pk = kb->pkt->pkt.public_key;
   log_assert (pk_is_primary (pk));
 
-  fingerprint = hexfingerprint (pk, NULL, 0);
-
   dbs = opendbs (ctrl);
   if (! dbs)
     {

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

Summary of changes:
 g10/tofu.c                         |   2 -
 tests/gpgscm/ffi.scm               |   1 +
 tests/gpgscm/opdefines.h           |   4 +-
 tests/gpgscm/scheme-private.h      |   6 ++
 tests/gpgscm/scheme.c              | 209 +++++++++++++++++++++++++++----------
 tests/gpgscm/scheme.h              |   8 ++
 tests/openpgp/conventional-mdc.scm |   2 +-
 tests/openpgp/conventional.scm     |   2 +-
 tests/openpgp/defs.scm             |  20 ++--
 tests/openpgp/encrypt-dsa.scm      |   2 +-
 tests/openpgp/encrypt.scm          |   2 +-
 tests/openpgp/gpgtar.scm           |   3 +-
 tests/openpgp/sigs.scm             |   2 +-
 13 files changed, 188 insertions(+), 75 deletions(-)


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




More information about the Gnupg-commits mailing list