[git] GCRYPT - branch, master, updated. libgcrypt-1.7.3-23-g995ce69

by Werner Koch cvs at cvs.gnupg.org
Tue Dec 6 22:21:41 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 crypto library".

The branch, master has been updated
       via  995ce697308320c6a52a307f83dc49eeb8d784b4 (commit)
      from  984a97f0750f812f0ad3c343ee6a67560953a504 (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 995ce697308320c6a52a307f83dc49eeb8d784b4
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Dec 6 22:19:04 2016 +0100

    Fix compiler warning about possible-NULL-dreference
    * src/mpi.h (mpi_is_const, mpi_is_immutable): Do check arg before
    deref-ing.  The are only used at places where the arg shall not be NULL.
    This was designed as a general purpose macro and written in a
    defensive way.  However, if it a NULL would be passed to that macro
    code run in the else branch will deref the arg anyway.
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/mpi.h b/src/mpi.h
index cd539f5..b5385b5 100644
--- a/src/mpi.h
+++ b/src/mpi.h
@@ -109,8 +109,8 @@ struct gcry_mpi
 void _gcry_mpi_immutable_failed (void);
 #define mpi_immutable_failed() _gcry_mpi_immutable_failed ()
-#define mpi_is_const(a)       ((a) && ((a)->flags&32))
-#define mpi_is_immutable(a)   ((a) && ((a)->flags&16))
+#define mpi_is_const(a)       ((a)->flags&32)
+#define mpi_is_immutable(a)   ((a)->flags&16)
 #define mpi_is_opaque(a)      ((a) && ((a)->flags&4))
 #define mpi_is_secure(a)      ((a) && ((a)->flags&1))
 #define mpi_clear(a)          _gcry_mpi_clear ((a))


Summary of changes:
 src/mpi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

The GNU crypto library

Gnupg-commits mailing list
Gnupg-commits at gnupg.org

More information about the Gcrypt-devel mailing list