aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyedit.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-01-06 07:42:07 +0000
committerWerner Koch <[email protected]>2016-01-06 07:42:07 +0000
commit7990586828a252e78d2ecacbaaa152431d7e08c8 (patch)
treed7f21839b16fff0394c5751db57947ea21f32a95 /g10/keyedit.c
parentkbx: Avoid faulty fclose in an error case. (diff)
downloadgnupg-7990586828a252e78d2ecacbaaa152431d7e08c8.tar.gz
gnupg-7990586828a252e78d2ecacbaaa152431d7e08c8.zip
gpg: Comment on false positives by static analyzers.
--
Diffstat (limited to '')
-rw-r--r--g10/keyedit.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c
index a30305870..1c302b7ab 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -363,7 +363,13 @@ check_all_keysigs (KBNODE keyblock, int only_selected, int only_selfsigs)
if (only_selfsigs
&& !(keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1]))
- ; /* Not a selfsig but we want only selfsigs - skip. */
+ {
+ /* Not a selfsig but we want only selfsigs - skip. */
+ /* Static analyzer note: A claim that KEYID above has
+ garbage is not correct because KEYID is set from the
+ public key packet which is always the first packet in
+ a keyblock and thus parsed before this signature. */
+ }
else if (print_and_check_one_sig (keyblock, node, &inv_sigs,
&no_key, &oth_err, &selfsig,
0, only_selfsigs))
@@ -856,6 +862,14 @@ sign_uids (ctrl_t ctrl, estream_t fp,
if (primary_pk->expiredate && !selfsig)
{
+ /* Static analyzer note: A claim that PRIMARY_PK might be
+ NULL is not correct because it set from the public key
+ packet which is always the first packet in a keyblock and
+ parsed in the above loop over the keyblock. In case the
+ keyblock has no packets at all and thus the loop was not
+ entered the above count_uids_with_flag would have
+ detected this case. */
+
u32 now = make_timestamp ();
if (primary_pk->expiredate <= now)