[PATCH 1/3] Remove unnecessary duplicate check.

Günther Noack gnoack at google.com
Thu Jan 22 16:35:27 CET 2015


Hello developers,

this and the following two patches are some trivial bugs found with
the Clang static analyzer.  Patch 1 and 2 remove unnecessary duplicate
checks, patch 3 addresses a copy&paste glitch which mixes up int and
unsigned int.

Thanks,
Guenther

---
 sm/verify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sm/verify.c b/sm/verify.c
index 2e91137..73e0ab4 100644
--- a/sm/verify.c
+++ b/sm/verify.c
@@ -467,7 +467,7 @@ gpgsm_verify (ctrl_t ctrl, int in_fd, int data_fd, estream_t out_fp)
           s = gcry_md_read (data_md, algo);
           if ( !s || !msgdigestlen
                || gcry_md_get_algo_dlen (algo) != msgdigestlen
-               || !s || memcmp (s, msgdigest, msgdigestlen) )
+               || memcmp (s, msgdigest, msgdigestlen) )
             {
               char *fpr;

--
2.2.2



More information about the Gnupg-devel mailing list