Home GnuPG

Fix compiler warning about possible-NULL-dreference
995ce6973083Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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>

Details

Provenance
wernerAuthored on Dec 6 2016, 10:19 PM
Parents
rC984a97f0750f: Fix possible NULL-deref in gcry_log_debugsxp
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rC995ce6973083: Fix compiler warning about possible-NULL-dreference (authored by Werner Koch <wk@gnupg.org>).Dec 6 2016, 10:19 PM