Fix compiler warning about possible-NULL-dreference
authorWerner Koch <wk@gnupg.org>
Tue, 6 Dec 2016 21:19:04 +0000 (22:19 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 6 Dec 2016 21:19:04 +0000 (22:19 +0100)
commit995ce697308320c6a52a307f83dc49eeb8d784b4
tree56692d59f962a2ee5d7ac0389231b3ed4fa1efcb
parent984a97f0750f812f0ad3c343ee6a67560953a504
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@gnupg.org>
src/mpi.h