summaryrefslogtreecommitdiffstats
path: root/g10/keylist.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-03-15 12:30:06 +0100
committerWerner Koch <wk@gnupg.org>2015-03-15 12:39:56 +0100
commitc59b410cf1d5676de7061e5a183c01227aa8e760 (patch)
treea89a112b0f336ffbea88a92949b068f4680e3c99 /g10/keylist.c
parentscd: Fix possible NULL deref in apdu.c (diff)
downloadgnupg2-c59b410cf1d5676de7061e5a183c01227aa8e760.tar.xz
gnupg2-c59b410cf1d5676de7061e5a183c01227aa8e760.zip
gpg: Remove useless condition.
* g10/keylist.c (list_keyblock_colon): Remove useless condition (PK). (list_keyblock_print): Likewise. -- PK is already derefed above and thus testing for PK is dead code. Detected by Stack 0.3: bug: anti-simplify model: | %tobool200 = icmp ne %struct.PKT_public_key* %3, null, !dbg !1498 --> true stack: - /home/wk/s/gnupg/g10/keylist.c:1367:0 ncore: 1 core: - /home/wk/s/gnupg/g10/keylist.c:1319:0 - null pointer dereference bug: anti-simplify model: | %tobool102 = icmp ne %struct.PKT_public_key* %4, null, !dbg !1462 --> true stack: - /home/wk/s/gnupg/g10/keylist.c:978:0 ncore: 1 core: - /home/wk/s/gnupg/g10/keylist.c:955:0 - null pointer dereference bug: anti-simplify model: | %tobool128 = icmp ne %struct.PKT_public_key* %4, null, !dbg !1469 --> true stack: - /home/wk/s/gnupg/g10/keylist.c:990:0 ncore: 1 core: - /home/wk/s/gnupg/g10/keylist.c:955:0 - null pointer dereference
Diffstat (limited to 'g10/keylist.c')
-rw-r--r--g10/keylist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/g10/keylist.c b/g10/keylist.c
index 03b9bbb90..925109a37 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -975,7 +975,7 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, void *opaque)
{
PKT_user_id *uid = node->pkt->pkt.user_id;
- if (pk && (uid->is_expired || uid->is_revoked)
+ if ((uid->is_expired || uid->is_revoked)
&& !(opt.list_options & LIST_SHOW_UNUSABLE_UIDS))
{
skip_sigs = 1;
@@ -988,7 +988,7 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, void *opaque)
dump_attribs (uid, pk);
if ((uid->is_revoked || uid->is_expired)
- || ((opt.list_options & LIST_SHOW_UID_VALIDITY) && pk))
+ || (opt.list_options & LIST_SHOW_UID_VALIDITY))
{
const char *validity;
int indent;
@@ -1364,7 +1364,7 @@ list_keyblock_colon (KBNODE keyblock, int secret, int has_secret, int fpr)
{
int uid_validity;
- if (pk && !ulti_hack)
+ if (!ulti_hack)
uid_validity = get_validity_info (pk, uid);
else
uid_validity = 'u';