[git] GnuPG - branch, master, updated. gnupg-2.1.20-13-gf1dc34f

by Justus Winter cvs at cvs.gnupg.org
Thu Apr 6 16:26:49 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  f1dc34f502a68673e7a29f3fcf57b8dc6a4fac89 (commit)
       via  b83903f59ec5d49ac579f263da70ebc8dc3645b5 (commit)
      from  23f00f109ddba595db4f73a6182750177c7dd75d (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 f1dc34f502a68673e7a29f3fcf57b8dc6a4fac89
Author: Justus Winter <justus at g10code.com>
Date:   Thu Apr 6 16:24:49 2017 +0200

    gpgscm: Avoid mutating integer.
    
    * tests/gpgscm/scheme.c (opexe_5): Do not modify the integer in-place
    while printing an vector.  Integer objects may be shared, so they must
    not be mutated.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 3719e53..aa0cf69 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -5181,7 +5181,7 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
                s_return(sc,sc->T);
           } else {
                pointer elem=vector_elem(vec,i);
-               ivalue_unchecked(cdr(sc->args))=i+1;
+               cdr(sc->args) = mk_integer(sc, i + 1);
                s_save(sc,OP_PVECFROM, sc->args, sc->NIL);
                sc->args=elem;
                if (i > 0)

commit b83903f59ec5d49ac579f263da70ebc8dc3645b5
Author: Justus Winter <justus at g10code.com>
Date:   Thu Apr 6 16:21:48 2017 +0200

    gpgscm: Initialize unused slots in vectors.
    
    * tests/gpgscm/scheme.c (get_vector_object): Initialize unused slots
    at the end of vectors.
    --
    
    They should not be used for anything, but let's just initialize them
    to something benign to be sure.
    
    GnuPG-bug-id: 3014
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 51fdef0..3719e53 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -1083,11 +1083,19 @@ static pointer get_cell(scheme *sc, pointer a, pointer b)
 static pointer get_vector_object(scheme *sc, int len, pointer init)
 {
   pointer cells = get_consecutive_cells(sc, vector_size(len));
+  int i;
+  int alloc_len = 1 + 3 * (vector_size(len) - 1);
   if(sc->no_memory) { return sc->sink; }
   /* Record it as a vector so that gc understands it. */
   typeflag(cells) = (T_VECTOR | T_ATOM | T_FINALIZE);
   vector_length(cells) = len;
   fill_vector(cells,init);
+
+  /* Initialize the unused slots at the end.  */
+  assert (alloc_len - len < 3);
+  for (i = len; i < alloc_len; i++)
+    cells->_object._vector._elements[i] = sc->NIL;
+
   if (gc_enabled (sc))
     push_recent_alloc(sc, cells, sc->NIL);
   return cells;

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

Summary of changes:
 tests/gpgscm/scheme.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


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




More information about the Gnupg-commits mailing list