gnupg2-2.4.9-1.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-758): [#def1]
/etc/profile.d/gnupg2.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> export GPG_TTY=$(tty)

Error: SHELLCHECK_WARNING (CWE-571): [#def2]
/etc/profile.d/gnupg2.sh:1:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#    1|-> export GPG_TTY=$(tty)

Error: SHELLCHECK_WARNING (CWE-569): [#def3]
/usr/bin/addgnupghome:118:13: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems.
#  116|   fi
#  117|   
#  118|-> for name in $*; do
#  119|       one_user $name
#  120|   done

Error: SHELLCHECK_WARNING (CWE-477): [#def4]
/usr/bin/applygnupgdefaults:34:23: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   32|   cleanup ()
#   33|   {
#   34|->     [ -n "$errorfile" -a -f "$errorfile" ] && rm "$errorfile"
#   35|   }
#   36|   trap cleanup EXIT SIGINT SIGHUP SIGPIPE

Error: SHELLCHECK_WARNING: [#def5]
/usr/bin/applygnupgdefaults:36:19: warning[SC3048]: In POSIX sh, prefixing signal names with 'SIG' is undefined.
#   34|       [ -n "$errorfile" -a -f "$errorfile" ] && rm "$errorfile"
#   35|   }
#   36|-> trap cleanup EXIT SIGINT SIGHUP SIGPIPE
#   37|   errorfile=$(mktemp "/tmp/$PGM.log.XXXXXX")
#   38|   [ -n "$errorfile" -a -f "$errorfile" ] || exit 2

Error: SHELLCHECK_WARNING: [#def6]
/usr/bin/applygnupgdefaults:36:26: warning[SC3048]: In POSIX sh, prefixing signal names with 'SIG' is undefined.
#   34|       [ -n "$errorfile" -a -f "$errorfile" ] && rm "$errorfile"
#   35|   }
#   36|-> trap cleanup EXIT SIGINT SIGHUP SIGPIPE
#   37|   errorfile=$(mktemp "/tmp/$PGM.log.XXXXXX")
#   38|   [ -n "$errorfile" -a -f "$errorfile" ] || exit 2

Error: SHELLCHECK_WARNING: [#def7]
/usr/bin/applygnupgdefaults:36:33: warning[SC3048]: In POSIX sh, prefixing signal names with 'SIG' is undefined.
#   34|       [ -n "$errorfile" -a -f "$errorfile" ] && rm "$errorfile"
#   35|   }
#   36|-> trap cleanup EXIT SIGINT SIGHUP SIGPIPE
#   37|   errorfile=$(mktemp "/tmp/$PGM.log.XXXXXX")
#   38|   [ -n "$errorfile" -a -f "$errorfile" ] || exit 2

Error: SHELLCHECK_WARNING (CWE-477): [#def8]
/usr/bin/applygnupgdefaults:38:19: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   36|   trap cleanup EXIT SIGINT SIGHUP SIGPIPE
#   37|   errorfile=$(mktemp "/tmp/$PGM.log.XXXXXX")
#   38|-> [ -n "$errorfile" -a -f "$errorfile" ] || exit 2
#   39|   
#   40|   # Check whether we can use getent

Error: SHELLCHECK_WARNING (CWE-156): [#def9]
/usr/bin/applygnupgdefaults:57:6: warning[SC2046]: Quote this to prevent word splitting.
#   55|   fi
#   56|   
#   57|-> if [ $(id -u) -ne 0 ]; then
#   58|       error "needs to be run as root"
#   59|       exit 1

Error: SHELLCHECK_WARNING (CWE-563): [#def10]
/usr/bin/applygnupgdefaults:63:30: warning[SC2034]: dmy_a appears unused. Verify use (or export if used externally).
#   61|   
#   62|   ${cat_passwd} \
#   63|->   | while IFS=: read -r user dmy_a uid dmy_c dmy_d home shell dmy_rest; do
#   64|       # Process only entries with a valid login shell
#   65|       grep </etc/shells "^$shell" 2>/dev/null >/dev/null || continue

Error: SHELLCHECK_WARNING (CWE-563): [#def11]
/usr/bin/applygnupgdefaults:63:40: warning[SC2034]: dmy_c appears unused. Verify use (or export if used externally).
#   61|   
#   62|   ${cat_passwd} \
#   63|->   | while IFS=: read -r user dmy_a uid dmy_c dmy_d home shell dmy_rest; do
#   64|       # Process only entries with a valid login shell
#   65|       grep </etc/shells "^$shell" 2>/dev/null >/dev/null || continue

Error: SHELLCHECK_WARNING (CWE-563): [#def12]
/usr/bin/applygnupgdefaults:63:46: warning[SC2034]: dmy_d appears unused. Verify use (or export if used externally).
#   61|   
#   62|   ${cat_passwd} \
#   63|->   | while IFS=: read -r user dmy_a uid dmy_c dmy_d home shell dmy_rest; do
#   64|       # Process only entries with a valid login shell
#   65|       grep </etc/shells "^$shell" 2>/dev/null >/dev/null || continue

Error: SHELLCHECK_WARNING (CWE-563): [#def13]
/usr/bin/applygnupgdefaults:63:63: warning[SC2034]: dmy_rest appears unused. Verify use (or export if used externally).
#   61|   
#   62|   ${cat_passwd} \
#   63|->   | while IFS=: read -r user dmy_a uid dmy_c dmy_d home shell dmy_rest; do
#   64|       # Process only entries with a valid login shell
#   65|       grep </etc/shells "^$shell" 2>/dev/null >/dev/null || continue

Error: GCC_ANALYZER_WARNING (CWE-457): [#def14]
gnupg-2.4.9/agent/call-pinentry.c:1367:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*thread_p’
gnupg-2.4.9/agent/call-pinentry.c:2034:1: enter_function: entry to ‘popup_message_thread’
gnupg-2.4.9/agent/call-pinentry.c:2040:8: call_function: calling ‘watch_sock_start’ from ‘popup_message_thread’
gnupg-2.4.9/agent/call-pinentry.c:2040:8: return_function: returning to ‘popup_message_thread’ from ‘watch_sock_start’
gnupg-2.4.9/agent/call-pinentry.c:2041:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/agent/call-pinentry.c:2048:3: branch_false: ...to here
gnupg-2.4.9/agent/call-pinentry.c:2050:3: call_function: calling ‘watch_sock_end’ from ‘popup_message_thread’
# 1365|   
# 1366|     *sock_p = GNUPG_INVALID_FD;
# 1367|->   err = npth_join (*thread_p, NULL);
# 1368|     if (err)
# 1369|       log_error ("watch_sock_end: error joining thread: %s\n", strerror (err));

Error: GCC_ANALYZER_WARNING (CWE-121): [#def15]
gnupg-2.4.9/agent/call-scd.c:602:11: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
gnupg-2.4.9/agent/call-scd.c:590:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/agent/call-scd.c:595:8: branch_false: ...to here
gnupg-2.4.9/agent/call-scd.c:595:17: branch_true: following ‘true’ branch...
gnupg-2.4.9/agent/call-scd.c:595:17: branch_true: ...to here
gnupg-2.4.9/agent/call-scd.c:598:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/agent/call-scd.c:600:7: branch_false: ...to here
gnupg-2.4.9/agent/call-scd.c:600:17: branch_true: following ‘true’ branch...
gnupg-2.4.9/agent/call-scd.c:602:11: danger: out-of-bounds write from byte 1002 till byte 1009 but ‘line’ ends at byte 1002
#  600|         for (i=0; len < indatalen && (i*2 < DIM(line)-50); i++, len++)
#  601|           {
#  602|->           sprintf (p, "%02X", indata[len]);
#  603|             p += 2;
#  604|           }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def16]
gnupg-2.4.9/agent/command.c:354:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/agent/command.c:353:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/agent/command.c:354:9: throw: if ‘vprint_assuan_status_strings’ throws an exception...
gnupg-2.4.9/agent/command.c:354:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  352|   
#  353|     va_start (arg_ptr, keyword);
#  354|->   err = vprint_assuan_status_strings (ctx, keyword, arg_ptr);
#  355|     va_end (arg_ptr);
#  356|     return err;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def17]
gnupg-2.4.9/agent/command.c:370:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/agent/command.c:369:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/agent/command.c:370:9: throw: if ‘vprint_assuan_status’ throws an exception...
gnupg-2.4.9/agent/command.c:370:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  368|   
#  369|     va_start (arg_ptr, format);
#  370|->   err = vprint_assuan_status (ctx, keyword, format, arg_ptr);
#  371|     va_end (arg_ptr);
#  372|     return err;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def18]
gnupg-2.4.9/agent/cvt-openpgp.c:1220:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘bufarr[i]’
gnupg-2.4.9/agent/cvt-openpgp.c:1190:3: branch_false: following ‘false’ branch (when ‘npkey < nskey’)...
gnupg-2.4.9/agent/cvt-openpgp.c:1191:3: branch_false: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1191:3: branch_false: following ‘false’ branch...
gnupg-2.4.9/agent/cvt-openpgp.c:1191:3: branch_false: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1196:26: branch_true: following ‘true’ branch (when ‘i < nskey’)...
gnupg-2.4.9/agent/cvt-openpgp.c:1198:35: branch_true: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1203:14: branch_true: following ‘true’ branch...
gnupg-2.4.9/agent/cvt-openpgp.c:1204:19: branch_true: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1196:26: branch_true: following ‘true’ branch (when ‘i < nskey’)...
gnupg-2.4.9/agent/cvt-openpgp.c:1198:35: branch_true: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1198:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/agent/cvt-openpgp.c:1200:15: branch_true: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1203:14: branch_true: following ‘true’ branch...
gnupg-2.4.9/agent/cvt-openpgp.c:1204:19: branch_true: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1219:23: branch_true: following ‘true’ branch (when ‘i < j’)...
gnupg-2.4.9/agent/cvt-openpgp.c:1220:13: branch_true: ...to here
gnupg-2.4.9/agent/cvt-openpgp.c:1220:13: danger: use of uninitialized value ‘bufarr[i]’ here
# 1218|           {
# 1219|             for (i = 0; i < j; i++)
# 1220|->             xfree (bufarr[i]);
# 1221|             return err;
# 1222|           }

Error: COMPILER_WARNING (CWE-704): [#def19]
gnupg-2.4.9/agent/cvt-openpgp.h:27:13: warning[-Wlto-type-mismatch]: type of ‘convert_from_openpgp_native’ does not match original declaration
#   27 | gpg_error_t convert_from_openpgp_native (ctrl_t ctrl,
#      |             ^
gnupg-2.4.9/agent/t-protect.c:344:1: note: type mismatch in parameter 4
#  344 | convert_from_openpgp_native (gcry_sexp_t s_pgp, const char *passphrase,
#      | ^
gnupg-2.4.9/agent/t-protect.c:344:1: note: ‘convert_from_openpgp_native’ was previously declared here
#   25|                                     const char *cache_nonce,
#   26|                                     unsigned char **r_key, char **r_passphrase);
#   27|-> gpg_error_t convert_from_openpgp_native (ctrl_t ctrl,
#   28|                                            gcry_sexp_t s_pgp,
#   29|                                            const char *passphrase,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
gnupg-2.4.9/agent/gpg-agent.c:2261:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘assuan_sock_new(1, 1, 0)’
gnupg-2.4.9/agent/gpg-agent.c:2234:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/agent/gpg-agent.c:2241:6: branch_false: ...to here
gnupg-2.4.9/agent/gpg-agent.c:2250:8: branch_false: following ‘false’ branch...
gnupg-2.4.9/agent/gpg-agent.c:2261:9: branch_false: ...to here
gnupg-2.4.9/agent/gpg-agent.c:2328:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/agent/gpg-agent.c:2338:7: branch_false: ...to here
gnupg-2.4.9/agent/gpg-agent.c:2341:3: throw: if ‘gcry_free’ throws an exception...
gnupg-2.4.9/agent/gpg-agent.c:2261:9: danger: ‘assuan_sock_new(1, 1, 0)’ leaks here
# 2259|           agent_exit (2);
# 2260|         }
# 2261|->     if (redirected)
# 2262|         {
# 2263|           *r_redir_name = xstrdup (unaddr->sun_path);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def21]
gnupg-2.4.9/common/asshelp.c:474:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
gnupg-2.4.9/common/asshelp.c:408:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/asshelp.c:414:3: branch_false: ...to here
gnupg-2.4.9/common/asshelp.c:448:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/asshelp.c:459:10: branch_true: ...to here
gnupg-2.4.9/common/asshelp.c:459:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/asshelp.c:461:15: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/asshelp.c:465:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/asshelp.c:473:15: branch_false: ...to here
gnupg-2.4.9/common/asshelp.c:474:11: danger: dereference of NULL ‘p’
#  472|               }
#  473|             p = strchr (program, '|');
#  474|->           *p++ = 0;
#  475|             program_arg = p;
#  476|           }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def22]
gnupg-2.4.9/common/asshelp2.c:69:8: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/asshelp2.c:84:1: enter_function: entry to ‘print_assuan_status’
gnupg-2.4.9/common/asshelp2.c:91:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/asshelp2.c:92:9: call_function: calling ‘vprint_assuan_status’ from ‘print_assuan_status’
#   67|     char *buf;
#   68|   
#   69|->   rc = gpgrt_vasprintf (&buf, format, arg_ptr);
#   70|     if (rc < 0)
#   71|       return gpg_err_make (default_errsource, gpg_err_code_from_syserror ());

Error: GCC_ANALYZER_WARNING (CWE-404): [#def23]
gnupg-2.4.9/common/asshelp2.c:141:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/asshelp2.c:149:1: enter_function: entry to ‘print_assuan_status_strings’
gnupg-2.4.9/common/asshelp2.c:154:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/asshelp2.c:155:9: call_function: calling ‘vprint_assuan_status_strings’ from ‘print_assuan_status_strings’
#  139|       }
#  140|     *p = 0;
#  141|->   err = assuan_write_status (ctx, keyword, buf);
#  142|   
#  143|     return err;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def24]
gnupg-2.4.9/common/asshelp2.c:193:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/asshelp2.c:189:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/asshelp2.c:192:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/asshelp2.c:193:9: throw: if ‘get_status_string’ throws an exception...
gnupg-2.4.9/common/asshelp2.c:193:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  191|   
#  192|     va_start (arg_ptr, format);
#  193|->   err = vprint_assuan_status (ctx, get_status_string (no), format, arg_ptr);
#  194|     va_end (arg_ptr);
#  195|     return err;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def25]
gnupg-2.4.9/common/audit.c:384:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/audit.c:1165:1: enter_function: entry to ‘audit_print_result’
gnupg-2.4.9/common/audit.c:1175:6: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
gnupg-2.4.9/common/audit.c:1178:18: branch_false: ...to here
gnupg-2.4.9/common/audit.c:1185:3: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/audit.c:1186:3: branch_true: ...to here
gnupg-2.4.9/common/audit.c:1196:7: call_function: calling ‘writeout_para’ from ‘audit_print_result’
#  382|     char *buf;
#  383|   
#  384|->   gpgrt_vasprintf (&buf, format, arg_ptr);
#  385|     if (buf)
#  386|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
gnupg-2.4.9/common/dotlock.c:577:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*h.lockname, 0)’
gnupg-2.4.9/common/dotlock.c:555:14: acquire_resource: opened here
gnupg-2.4.9/common/dotlock.c:555:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/dotlock.c:555:6: branch_false: ...to here
gnupg-2.4.9/common/dotlock.c:577:13: danger: ‘open(*h.lockname, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  575|     do
#  576|       {
#  577|->       res = read (fd, p, expected_len - nread);
#  578|         if (res == -1 && errno == EINTR)
#  579|           continue;

Error: COMPILER_WARNING (CWE-252): [#def27]
gnupg-2.4.9/common/dotlock.c: scope_hint: In function ‘use_hardlinks_p’
gnupg-2.4.9/common/dotlock.c:667:10: warning[-Wunused-result]: ignoring return value of ‘link’ declared with attribute ‘warn_unused_result’
#  667 |   (void) link (tname, lname);
#      |          ^~~~~~~~~~~~~~~~~~~
#  665|   
#  666|     /* We ignore the return value of link() because it is unreliable.  */
#  667|->   (void) link (tname, lname);
#  668|   
#  669|     if (stat (tname, &sb))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
gnupg-2.4.9/common/dotlock.c:715:15: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(make_dirname(*h.lockname))’
gnupg-2.4.9/common/dotlock.c:701:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/dotlock.c:704:29: branch_false: ...to here
gnupg-2.4.9/common/dotlock.c:707:9: acquire_memory: allocated here
gnupg-2.4.9/common/dotlock.c:708:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/dotlock.c:708:6: branch_false: ...to here
gnupg-2.4.9/common/dotlock.c:715:15: throw: if ‘readdir’ throws an exception...
gnupg-2.4.9/common/dotlock.c:715:15: danger: ‘opendir(make_dirname(*h.lockname))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  713|       }
#  714|   
#  715|->   while ((d = readdir (dir)))
#  716|       if (sb.st_ino == d->d_ino && strcmp (d->d_name, basename))
#  717|         break;

Error: COMPILER_WARNING (CWE-252): [#def29]
gnupg-2.4.9/common/dotlock.c: scope_hint: In function ‘dotlock_take_unix’
gnupg-2.4.9/common/dotlock.c:1349:14: warning[-Wunused-result]: ignoring return value of ‘link’ declared with attribute ‘warn_unused_result’
# 1349 |       (void) link (h->tname, h->lockname);
#      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1347|   
# 1348|         /* We ignore the return value of link() because it is unreliable.  */
# 1349|->       (void) link (h->tname, h->lockname);
# 1350|   
# 1351|         if (stat (h->tname, &sb))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
gnupg-2.4.9/common/exechelp-posix.c:84:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘errpipe[1]’
gnupg-2.4.9/common/exechelp-posix.c:437:1: enter_function: entry to ‘gnupg_spawn_process’
gnupg-2.4.9/common/exechelp-posix.c:453:6: branch_false: following ‘false’ branch (when ‘r_infp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:455:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:455:6: branch_false: following ‘false’ branch (when ‘r_outfp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_true: following ‘true’ branch (when ‘r_errfp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:458:5: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:461:6: branch_false: following ‘false’ branch (when ‘r_infp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:468:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:468:6: branch_false: following ‘false’ branch (when ‘r_outfp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:484:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:484:6: branch_true: following ‘true’ branch (when ‘r_errfp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:486:13: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:486:13: call_function: calling ‘create_pipe_and_estream’ from ‘gnupg_spawn_process’
#   82|   my_error_from_syserror (void)
#   83|   {
#   84|->   return gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
#   85|   }
#   86|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
gnupg-2.4.9/common/exechelp-posix.c:84:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inpipe[0]’
gnupg-2.4.9/common/exechelp-posix.c:437:1: enter_function: entry to ‘gnupg_spawn_process’
gnupg-2.4.9/common/exechelp-posix.c:453:6: branch_true: following ‘true’ branch (when ‘r_infp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:454:5: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:455:6: branch_false: following ‘false’ branch (when ‘r_outfp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_true: following ‘true’ branch (when ‘r_errfp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:458:5: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:461:6: branch_true: following ‘true’ branch (when ‘r_infp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:463:13: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:463:13: call_function: calling ‘create_pipe_and_estream’ from ‘gnupg_spawn_process’
#   82|   my_error_from_syserror (void)
#   83|   {
#   84|->   return gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
#   85|   }
#   86|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
gnupg-2.4.9/common/exechelp-posix.c:124:29: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/proc/self/fd")’
gnupg-2.4.9/common/exechelp-posix.c:121:11: acquire_memory: allocated here
gnupg-2.4.9/common/exechelp-posix.c:122:8: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/exechelp-posix.c:122:8: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:124:29: throw: if ‘readdir’ throws an exception...
gnupg-2.4.9/common/exechelp-posix.c:124:29: danger: ‘opendir("/proc/self/fd")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  122|       if (dir)
#  123|         {
#  124|->         while ((dir_entry = readdir (dir)))
#  125|             {
#  126|               s = dir_entry->d_name;

Error: COMPILER_WARNING (CWE-704): [#def33]
gnupg-2.4.9/common/exechelp-posix.c: scope_hint: In function ‘do_exec’
gnupg-2.4.9/common/exechelp-posix.c:301:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  301 |   arg_list[0] = strrchr (pgmname, '/');
#      |               ^
#  299|         i++;
#  300|     arg_list = xcalloc (i+2, sizeof *arg_list);
#  301|->   arg_list[0] = strrchr (pgmname, '/');
#  302|     if (arg_list[0])
#  303|       arg_list[0]++;

Error: COMPILER_WARNING (CWE-704): [#def34]
gnupg-2.4.9/common/exechelp-posix.c:301:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  299|         i++;
#  300|     arg_list = xcalloc (i+2, sizeof *arg_list);
#  301|->   arg_list[0] = strrchr (pgmname, '/');
#  302|     if (arg_list[0])
#  303|       arg_list[0]++;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
gnupg-2.4.9/common/exechelp-posix.c:313:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", (int)(i != 0))’
gnupg-2.4.9/common/exechelp-posix.c:578:1: enter_function: entry to ‘gnupg_spawn_process_fd’
gnupg-2.4.9/common/exechelp-posix.c:584:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/exechelp-posix.c:591:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:591:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/exechelp-posix.c:593:7: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:595:7: call_function: calling ‘do_exec’ from ‘gnupg_spawn_process_fd’
#  311|     for (i=0; i <= 2; i++)
#  312|       {
#  313|->       if (nodevnull[i])
#  314|           continue;
#  315|         if (fds[i] == -1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
gnupg-2.4.9/common/exechelp-posix.c:329:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fds[i], i)’
gnupg-2.4.9/common/exechelp-posix.c:311:13: branch_true: following ‘true’ branch (when ‘i != 3’)...
gnupg-2.4.9/common/exechelp-posix.c:313:11: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:325:13: branch_true: following ‘true’ branch (when ‘i != 3’)...
gnupg-2.4.9/common/exechelp-posix.c:327:11: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:329:26: acquire_resource: opened here
gnupg-2.4.9/common/exechelp-posix.c:329:11: danger: ‘dup2(fds[i], i)’ leaks here; was opened at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  327|         if (nodevnull[i])
#  328|           continue;
#  329|->       if (fds[i] != i && dup2 (fds[i], i) == -1)
#  330|           log_fatal ("dup2 std%s failed: %s\n",
#  331|                      i==0?"in":i==1?"out":"err", strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
gnupg-2.4.9/common/exechelp-posix.c:382:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘errpipe[1]’
gnupg-2.4.9/common/exechelp-posix.c:437:1: enter_function: entry to ‘gnupg_spawn_process’
gnupg-2.4.9/common/exechelp-posix.c:453:6: branch_false: following ‘false’ branch (when ‘r_infp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:455:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:455:6: branch_false: following ‘false’ branch (when ‘r_outfp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_true: following ‘true’ branch (when ‘r_errfp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:458:5: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:461:6: branch_false: following ‘false’ branch (when ‘r_infp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:468:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:468:6: branch_false: following ‘false’ branch (when ‘r_outfp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:484:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:484:6: branch_true: following ‘true’ branch (when ‘r_errfp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:486:13: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:486:13: call_function: calling ‘create_pipe_and_estream’ from ‘gnupg_spawn_process’
#  380|         log_error (_("error creating a stream for a pipe: %s\n"),
#  381|                    gpg_strerror (err));
#  382|->       close (filedes[0]);
#  383|         close (filedes[1]);
#  384|         filedes[0] = filedes[1] = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
gnupg-2.4.9/common/exechelp-posix.c:382:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inpipe[0]’
gnupg-2.4.9/common/exechelp-posix.c:437:1: enter_function: entry to ‘gnupg_spawn_process’
gnupg-2.4.9/common/exechelp-posix.c:453:6: branch_true: following ‘true’ branch (when ‘r_infp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:454:5: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:455:6: branch_false: following ‘false’ branch (when ‘r_outfp’ is NULL)...
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_false: ...to here
gnupg-2.4.9/common/exechelp-posix.c:457:6: branch_true: following ‘true’ branch (when ‘r_errfp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:458:5: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:461:6: branch_true: following ‘true’ branch (when ‘r_infp’ is non-NULL)...
gnupg-2.4.9/common/exechelp-posix.c:463:13: branch_true: ...to here
gnupg-2.4.9/common/exechelp-posix.c:463:13: call_function: calling ‘create_pipe_and_estream’ from ‘gnupg_spawn_process’
#  380|         log_error (_("error creating a stream for a pipe: %s\n"),
#  381|                    gpg_strerror (err));
#  382|->       close (filedes[0]);
#  383|         close (filedes[1]);
#  384|         filedes[0] = filedes[1] = -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def39]
gnupg-2.4.9/common/logging.h:50:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:670:1: enter_function: entry to ‘make_absfilename’
gnupg-2.4.9/common/stringhelp.c:675:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:676:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename’
#   48|   bug_at (const char *file, int line, const char *func)
#   49|   {
#   50|->   gpgrt_log (GPGRT_LOGLVL_BUG, "there is a bug at %s:%d:%s\n",
#   51|                file, line, func);
#   52|     abort ();

Error: GCC_ANALYZER_WARNING (CWE-404): [#def40]
gnupg-2.4.9/common/mapstrings.c:214:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/mapstrings.c:201:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/mapstrings.c:204:8: branch_false: ...to here
gnupg-2.4.9/common/mapstrings.c:213:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/mapstrings.c:214:15: throw: if ‘vstrconcat’ throws an exception...
gnupg-2.4.9/common/mapstrings.c:214:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  212|   
#  213|     va_start (arg_ptr, string1);
#  214|->   m->string = vstrconcat (string1, arg_ptr);
#  215|     va_end (arg_ptr);
#  216|     if (!m->string)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def41]
gnupg-2.4.9/common/membuf.c:151:8: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/membuf.c:150:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/membuf.c:151:8: throw: if ‘gpgrt_vasprintf’ throws an exception...
gnupg-2.4.9/common/membuf.c:151:8: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  149|   
#  150|     va_start (arg_ptr, format);
#  151|->   rc = gpgrt_vasprintf (&buf, format, arg_ptr);
#  152|     if (rc < 0)
#  153|       mb->out_of_core = errno ? errno : ENOMEM;

Error: COMPILER_WARNING (CWE-477): [#def42]
gnupg-2.4.9/common/miscellaneous.c: scope_hint: In function ‘setup_libgcrypt_logging’
gnupg-2.4.9/common/miscellaneous.c:103:3: warning[-Wdeprecated-declarations]: ‘gcry_set_log_handler’ is deprecated
#  103 |   gcry_set_log_handler (my_gcry_logger, NULL);
#      |   ^~~~~~~~~~~~~~~~~~~~
gnupg-2.4.9/common/util.h:34: included_from: Included from here.
gnupg-2.4.9/common/miscellaneous.c:35: included_from: Included from here.
/usr/include/gcrypt.h:2103:6: note: declared here
# 2103 | void gcry_set_log_handler (gcry_handler_log_t f,
#      |      ^~~~~~~~~~~~~~~~~~~~
#  101|   setup_libgcrypt_logging (void)
#  102|   {
#  103|->   gcry_set_log_handler (my_gcry_logger, NULL);
#  104|     gcry_set_fatalerror_handler (my_gcry_fatalerror_handler, NULL);
#  105|     gcry_set_outofcore_handler (my_gcry_outofcore_handler, NULL);

Error: COMPILER_WARNING (CWE-477): [#def43]
gnupg-2.4.9/common/miscellaneous.c:103:3: warning[-Wdeprecated-declarations]: ‘gcry_set_log_handler’ is deprecated
#  101|   setup_libgcrypt_logging (void)
#  102|   {
#  103|->   gcry_set_log_handler (my_gcry_logger, NULL);
#  104|     gcry_set_fatalerror_handler (my_gcry_fatalerror_handler, NULL);
#  105|     gcry_set_outofcore_handler (my_gcry_outofcore_handler, NULL);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def44]
gnupg-2.4.9/common/mkdir_p.c:168:22: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/mkdir_p.c:155:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/mkdir_p.c:158:3: branch_false: ...to here
gnupg-2.4.9/common/mkdir_p.c:160:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/mkdir_p.c:161:15: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/mkdir_p.c:163:10: branch_true: ...to here
gnupg-2.4.9/common/mkdir_p.c:163:10: branch_true: following ‘true’ branch (when ‘i == space’)...
gnupg-2.4.9/common/mkdir_p.c:167:11: branch_true: ...to here
gnupg-2.4.9/common/mkdir_p.c:168:22: throw: if ‘gcry_realloc’ throws an exception...
gnupg-2.4.9/common/mkdir_p.c:168:22: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  166|   
#  167|   	  space = 2 * space;
#  168|-> 	  tmp_dirs = xtryrealloc (dirs, space * sizeof (char *));
#  169|             if (!tmp_dirs)
#  170|               {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def45]
gnupg-2.4.9/common/mkdir_p.c:171:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/mkdir_p.c:155:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/mkdir_p.c:158:3: branch_false: ...to here
gnupg-2.4.9/common/mkdir_p.c:160:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/mkdir_p.c:161:15: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/mkdir_p.c:163:10: branch_true: ...to here
gnupg-2.4.9/common/mkdir_p.c:163:10: branch_true: following ‘true’ branch (when ‘i == space’)...
gnupg-2.4.9/common/mkdir_p.c:167:11: branch_true: ...to here
gnupg-2.4.9/common/mkdir_p.c:169:14: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/mkdir_p.c:171:21: branch_true: ...to here
gnupg-2.4.9/common/mkdir_p.c:171:21: throw: if ‘gpg_err_code_from_syserror’ throws an exception...
gnupg-2.4.9/common/mkdir_p.c:171:21: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  169|             if (!tmp_dirs)
#  170|               {
#  171|->               err = gpg_err_make (default_errsource,
#  172|                                     gpg_err_code_from_syserror ());
#  173|                 break;

Error: COMPILER_WARNING (CWE-704): [#def46]
gnupg-2.4.9/common/server-help.c: scope_hint: In function ‘option_value’
gnupg-2.4.9/common/server-help.c:173:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  173 |   s = strstr (line, name);
#      |     ^
#  171|     int n = strlen (name);
#  172|   
#  173|->   s = strstr (line, name);
#  174|     if (s && s >= skip_options (line))
#  175|       return NULL;

Error: COMPILER_WARNING (CWE-704): [#def47]
gnupg-2.4.9/common/server-help.c:173:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  171|     int n = strlen (name);
#  172|   
#  173|->   s = strstr (line, name);
#  174|     if (s && s >= skip_options (line))
#  175|       return NULL;

Error: COMPILER_WARNING (CWE-252): [#def48]
gnupg-2.4.9/common/signal.c: scope_hint: In function ‘got_fatal_signal’
gnupg-2.4.9/common/signal.c:113:9: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  113 |   (void)write (2, "\n", 1 );
#      |         ^~~~~~~~~~~~~~~~~~~
#  111|       cleanup_fnc ();
#  112|     /* Better don't translate these messages. */
#  113|->   (void)write (2, "\n", 1 );
#  114|     s = log_get_prefix (NULL);
#  115|     if (s)

Error: COMPILER_WARNING (CWE-252): [#def49]
gnupg-2.4.9/common/signal.c:116:11: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  116 |     (void)write(2, s, strlen (s));
#      |           ^~~~~~~~~~~~~~~~~~~~~~~
#  114|     s = log_get_prefix (NULL);
#  115|     if (s)
#  116|->     (void)write(2, s, strlen (s));
#  117|     (void)write (2, ": signal ", 9 );
#  118|     s = get_signal_name(sig);

Error: COMPILER_WARNING (CWE-252): [#def50]
gnupg-2.4.9/common/signal.c:117:9: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  117 |   (void)write (2, ": signal ", 9 );
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
#  115|     if (s)
#  116|       (void)write(2, s, strlen (s));
#  117|->   (void)write (2, ": signal ", 9 );
#  118|     s = get_signal_name(sig);
#  119|     if (s)

Error: COMPILER_WARNING (CWE-252): [#def51]
gnupg-2.4.9/common/signal.c:120:12: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  120 |     (void) write (2, s, strlen(s) );
#      |            ^~~~~~~~~~~~~~~~~~~~~~~~
#  118|     s = get_signal_name(sig);
#  119|     if (s)
#  120|->     (void) write (2, s, strlen(s) );
#  121|     else
#  122|       {

Error: COMPILER_WARNING (CWE-252): [#def52]
gnupg-2.4.9/common/signal.c:130:15: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  130 |         (void)write (2, "?", 1);
#      |               ^~~~~~~~~~~~~~~~~
#  128|            this is a bug in that system, we will protect against it.  */
#  129|         if (sig < 0 || sig >= 100000)
#  130|->         (void)write (2, "?", 1);
#  131|         else
#  132|           {

Error: COMPILER_WARNING (CWE-252): [#def53]
gnupg-2.4.9/common/signal.c:139:25: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  139 |                   (void)write (2, &"0123456789"[value/i], 1);
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  137|                 if (value >= i || ((any || i==1) && !(value/i)))
#  138|                   {
#  139|->                   (void)write (2, &"0123456789"[value/i], 1);
#  140|                     if ((value/i))
#  141|                       any = 1;

Error: COMPILER_WARNING (CWE-252): [#def54]
gnupg-2.4.9/common/signal.c:147:9: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  147 |   (void)write (2, " caught ... exiting\n", 20);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  145|           }
#  146|       }
#  147|->   (void)write (2, " caught ... exiting\n", 20);
#  148|   
#  149|     /* Reset action to default action and raise signal again */

Error: GCC_ANALYZER_WARNING (CWE-121): [#def55]
gnupg-2.4.9/common/simple-pwquery.c:301:11: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
gnupg-2.4.9/common/simple-pwquery.c:459:1: enter_function: entry to ‘simple_pwclear’
gnupg-2.4.9/common/simple-pwquery.c:466:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/simple-pwquery.c:469:3: branch_false: ...to here
gnupg-2.4.9/common/simple-pwquery.c:471:7: call_function: calling ‘copy_and_escape’ from ‘simple_pwclear’
#  299|         if (s[i] < ' ' || s[i] == '+')
#  300|           {
#  301|->           sprintf (p, "%%%02X", s[i]);
#  302|             p += 3;
#  303|           }

Error: COMPILER_WARNING: [#def56]
gnupg-2.4.9/common/ssh-utils.c: scope_hint: In function ‘get_fingerprint’
gnupg-2.4.9/common/ssh-utils.c:85:7: warning[-Wunused-but-set-variable=]: variable ‘idx’ set but not used
#   85 |   int idx;
#      |       ^~~
#   83|     const char *s;
#   84|     char *name = NULL;
#   85|->   int idx;
#   86|     const char *elems;
#   87|     gcry_md_hd_t md = NULL;

Error: COMPILER_WARNING (CWE-704): [#def57]
gnupg-2.4.9/common/stringhelp.c: scope_hint: In function ‘make_basename’
gnupg-2.4.9/common/stringhelp.c:379:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  379 |     if ( !(p=strrchr(filepath, '/')) )
#      |             ^
#  377|       (void)inputpath; /* Only required for riscos.  */
#  378|   
#  379|->     if ( !(p=strrchr(filepath, '/')) )
#  380|   #ifdef HAVE_DOSISH_SYSTEM
#  381|   	if ( !(p=strrchr(filepath, '\\')) )

Error: COMPILER_WARNING (CWE-704): [#def58]
gnupg-2.4.9/common/stringhelp.c:379:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  377|       (void)inputpath; /* Only required for riscos.  */
#  378|   
#  379|->     if ( !(p=strrchr(filepath, '/')) )
#  380|   #ifdef HAVE_DOSISH_SYSTEM
#  381|   	if ( !(p=strrchr(filepath, '\\')) )

Error: COMPILER_WARNING (CWE-704): [#def59]
gnupg-2.4.9/common/stringhelp.c: scope_hint: In function ‘make_dirname’
gnupg-2.4.9/common/stringhelp.c:408:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  408 |     if ( !(p=strrchr(filepath, '/')) )
#      |             ^
#  406|       char *p;
#  407|   
#  408|->     if ( !(p=strrchr(filepath, '/')) )
#  409|   #ifdef HAVE_DOSISH_SYSTEM
#  410|   	if ( !(p=strrchr(filepath, '\\')) )

Error: COMPILER_WARNING (CWE-704): [#def60]
gnupg-2.4.9/common/stringhelp.c:408:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  406|       char *p;
#  407|   
#  408|->     if ( !(p=strrchr(filepath, '/')) )
#  409|   #ifdef HAVE_DOSISH_SYSTEM
#  410|   	if ( !(p=strrchr(filepath, '\\')) )

Error: GCC_ANALYZER_WARNING (CWE-404): [#def61]
gnupg-2.4.9/common/stringhelp.c:440:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:670:1: enter_function: entry to ‘make_absfilename’
gnupg-2.4.9/common/stringhelp.c:675:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:676:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename’
#  438|   #ifdef HAVE_GETPWNAM
#  439|         /* Fixme: We should use getpwnam_r if available.  */
#  440|->       pwd = getpwnam (name);
#  441|   #endif
#  442|       }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def62]
gnupg-2.4.9/common/stringhelp.c:447:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:685:1: enter_function: entry to ‘make_absfilename_try’
gnupg-2.4.9/common/stringhelp.c:690:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:691:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename_try’
#  445|   #ifdef HAVE_GETPWUID
#  446|         /* Fixme: We should use getpwuid_r if available.  */
#  447|->       pwd = getpwuid (getuid());
#  448|   #endif
#  449|       }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def63]
gnupg-2.4.9/common/stringhelp.c:453:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:670:1: enter_function: entry to ‘make_absfilename’
gnupg-2.4.9/common/stringhelp.c:675:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:676:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename’
#  451|       {
#  452|         if (xmode)
#  453|->         result = xstrdup (pwd->pw_dir);
#  454|         else
#  455|           result = xtrystrdup (pwd->pw_dir);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def64]
gnupg-2.4.9/common/stringhelp.c:455:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:685:1: enter_function: entry to ‘make_absfilename_try’
gnupg-2.4.9/common/stringhelp.c:690:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:691:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename_try’
#  453|           result = xstrdup (pwd->pw_dir);
#  454|         else
#  455|->         result = xtrystrdup (pwd->pw_dir);
#  456|       }
#  457|   #else /*!HAVE_PWD_H*/

Error: GCC_ANALYZER_WARNING (CWE-404): [#def65]
gnupg-2.4.9/common/stringhelp.c:494:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:685:1: enter_function: entry to ‘make_absfilename_try’
gnupg-2.4.9/common/stringhelp.c:690:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:691:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename_try’
#  492|             if (xmode)
#  493|               BUG ();
#  494|->           gpg_err_set_errno (EINVAL);
#  495|             return NULL;
#  496|           }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def66]
gnupg-2.4.9/common/stringhelp.c:519:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:670:1: enter_function: entry to ‘make_absfilename’
gnupg-2.4.9/common/stringhelp.c:675:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:676:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename’
#  517|   
#  518|             if (xmode)
#  519|->             user = xstrdup (first_part+1);
#  520|             else
#  521|               {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def67]
gnupg-2.4.9/common/stringhelp.c:522:22: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:685:1: enter_function: entry to ‘make_absfilename_try’
gnupg-2.4.9/common/stringhelp.c:690:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:691:12: call_function: calling ‘do_make_filename’ from ‘make_absfilename_try’
#  520|             else
#  521|               {
#  522|->               user = xtrystrdup (first_part+1);
#  523|                 if (!user)
#  524|                   return NULL;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def68]
gnupg-2.4.9/common/stringhelp.c:1219:12: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/stringhelp.c:1252:1: enter_function: entry to ‘xstrconcat’
gnupg-2.4.9/common/stringhelp.c:1257:6: branch_false: following ‘false’ branch (when ‘s1’ is non-NULL)...
gnupg-2.4.9/common/stringhelp.c:1261:7: branch_false: ...to here
gnupg-2.4.9/common/stringhelp.c:1261:7: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/stringhelp.c:1262:16: call_function: calling ‘vstrconcat’ from ‘xstrconcat’
# 1217|       }
# 1218|     needed++;
# 1219|->   buffer = xtrymalloc (needed);
# 1220|     if (buffer)
# 1221|       {

Error: COMPILER_WARNING (CWE-704): [#def69]
gnupg-2.4.9/common/stringhelp.c: scope_hint: In function ‘split_fields’
gnupg-2.4.9/common/stringhelp.c:1432:12: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1432 |       pend = strchr (p, ' ');
#      |            ^
# 1430|           break;
# 1431|         array[n++] = p;
# 1432|->       pend = strchr (p, ' ');
# 1433|         if (!pend)
# 1434|           break;

Error: COMPILER_WARNING (CWE-704): [#def70]
gnupg-2.4.9/common/stringhelp.c:1432:12: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1430|           break;
# 1431|         array[n++] = p;
# 1432|->       pend = strchr (p, ' ');
# 1433|         if (!pend)
# 1434|           break;

Error: COMPILER_WARNING (CWE-704): [#def71]
gnupg-2.4.9/common/stringhelp.c: scope_hint: In function ‘split_fields_colon’
gnupg-2.4.9/common/stringhelp.c:1470:12: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1470 |       pend = strchr (p, ':');
#      |            ^
# 1468|           break;
# 1469|         array[n++] = p;
# 1470|->       pend = strchr (p, ':');
# 1471|         if (!pend)
# 1472|           break;

Error: COMPILER_WARNING (CWE-704): [#def72]
gnupg-2.4.9/common/stringhelp.c:1470:12: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1468|           break;
# 1469|         array[n++] = p;
# 1470|->       pend = strchr (p, ':');
# 1471|         if (!pend)
# 1472|           break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def73]
gnupg-2.4.9/common/sysutils.c:705:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
gnupg-2.4.9/common/sysutils.c:703:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/sysutils.c:705:11: acquire_resource: opened here
gnupg-2.4.9/common/sysutils.c:705:10: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  703|     if (fcntl (STDIN_FILENO, F_GETFD) == -1 && errno ==EBADF)
#  704|       {
#  705|->       if (open ("/dev/null",O_RDONLY) == STDIN_FILENO)
#  706|   	did_stdin = 1;
#  707|         else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def74]
gnupg-2.4.9/common/sysutils.c:713:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
gnupg-2.4.9/common/sysutils.c:711:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/sysutils.c:713:11: acquire_resource: opened here
gnupg-2.4.9/common/sysutils.c:713:10: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  711|     if (fcntl (STDOUT_FILENO, F_GETFD) == -1 && errno == EBADF)
#  712|       {
#  713|->       if (open ("/dev/null",O_WRONLY) == STDOUT_FILENO)
#  714|   	did_stdout = 1;
#  715|         else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def75]
gnupg-2.4.9/common/sysutils.c:721:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
gnupg-2.4.9/common/sysutils.c:719:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/sysutils.c:721:11: acquire_resource: opened here
gnupg-2.4.9/common/sysutils.c:721:10: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  719|     if (fcntl (STDERR_FILENO, F_GETFD)==-1 && errno==EBADF)
#  720|       {
#  721|->       if (open ("/dev/null", O_WRONLY) == STDERR_FILENO)
#  722|   	did_stderr = 1;
#  723|         else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
gnupg-2.4.9/common/sysutils.c:1355:10: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(name)’
gnupg-2.4.9/common/sysutils.c:1349:9: acquire_memory: allocated here
gnupg-2.4.9/common/sysutils.c:1352:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/sysutils.c:1355:10: branch_false: ...to here
gnupg-2.4.9/common/sysutils.c:1355:10: throw: if ‘gcry_malloc’ throws an exception...
gnupg-2.4.9/common/sysutils.c:1355:10: danger: ‘opendir(name)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1353|       return NULL;
# 1354|   
# 1355|->   gdir = xtrymalloc (sizeof *gdir);
# 1356|     if (!gdir)
# 1357|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
gnupg-2.4.9/common/sysutils.c:1362:7: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(name)’
gnupg-2.4.9/common/sysutils.c:1349:9: acquire_memory: allocated here
gnupg-2.4.9/common/sysutils.c:1352:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/sysutils.c:1355:10: branch_false: ...to here
gnupg-2.4.9/common/sysutils.c:1356:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/sysutils.c:1358:24: branch_true: ...to here
gnupg-2.4.9/common/sysutils.c:1362:7: danger: ‘opendir(name)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1360|         _wclosedir (dir);
# 1361|   #else
# 1362|->       closedir (dir);
# 1363|   #endif
# 1364|         gpg_err_set_errno (save_errno);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def78]
gnupg-2.4.9/common/sysutils.c:1829:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d’
gnupg-2.4.9/common/sysutils.c:1826:11: acquire_resource: opened here
gnupg-2.4.9/common/sysutils.c:1827:6: branch_false: following ‘false’ branch (when ‘d >= 0’)...
gnupg-2.4.9/common/sysutils.c:1829:3: branch_false: ...to here
gnupg-2.4.9/common/sysutils.c:1829:3: throw: if ‘close’ throws an exception...
gnupg-2.4.9/common/sysutils.c:1829:3: danger: ‘d’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1827|     if (d < 0)
# 1828|       return 0;
# 1829|->   close (d);
# 1830|     return 1;
# 1831|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def79]
gnupg-2.4.9/common/t-b64.c:181:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
gnupg-2.4.9/common/t-b64.c:173:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:173:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:173:16: acquire_resource: opened here
gnupg-2.4.9/common/t-b64.c:174:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:181:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:181:9: throw: if ‘b64enc_start’ throws an exception...
gnupg-2.4.9/common/t-b64.c:181:9: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  179|       }
#  180|   
#  181|->   err = b64enc_start (&state, stdout, "DATA");
#  182|     if (err)
#  183|       fail (1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
gnupg-2.4.9/common/t-b64.c:181:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
gnupg-2.4.9/common/t-b64.c:173:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:173:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:173:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:174:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:181:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:181:9: throw: if ‘b64enc_start’ throws an exception...
gnupg-2.4.9/common/t-b64.c:181:9: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  179|       }
#  180|   
#  181|->   err = b64enc_start (&state, stdout, "DATA");
#  182|     if (err)
#  183|       fail (1);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def81]
gnupg-2.4.9/common/t-b64.c:185:20: warning[-Wanalyzer-null-argument]: use of NULL ‘fp’ where non-null expected
gnupg-2.4.9/common/t-b64.c:173:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:173:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:173:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:174:6: release_memory: assuming ‘fp’ is NULL
gnupg-2.4.9/common/t-b64.c:174:6: branch_true: following ‘true’ branch (when ‘fp’ is NULL)...
gnupg-2.4.9/common/t-b64.c:177:70: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:176:7: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:176:7: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:185:20: danger: argument 4 (‘fp’) NULL where non-null expected
#  183|       fail (1);
#  184|   
#  185|->   while ( (nread = fread (buffer, 1, sizeof buffer, fp)) )
#  186|       {
#  187|         err = b64enc_write (&state, buffer, nread);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def82]
gnupg-2.4.9/common/t-b64.c:187:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
gnupg-2.4.9/common/t-b64.c:173:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:173:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:173:16: acquire_resource: opened here
gnupg-2.4.9/common/t-b64.c:174:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:181:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:185:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-b64.c:187:13: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:187:13: throw: if ‘b64enc_write’ throws an exception...
gnupg-2.4.9/common/t-b64.c:187:13: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  185|     while ( (nread = fread (buffer, 1, sizeof buffer, fp)) )
#  186|       {
#  187|->       err = b64enc_write (&state, buffer, nread);
#  188|         if (err)
#  189|           fail (2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
gnupg-2.4.9/common/t-b64.c:187:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
gnupg-2.4.9/common/t-b64.c:173:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:173:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:173:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:174:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:181:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:185:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-b64.c:187:13: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:187:13: throw: if ‘b64enc_write’ throws an exception...
gnupg-2.4.9/common/t-b64.c:187:13: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  185|     while ( (nread = fread (buffer, 1, sizeof buffer, fp)) )
#  186|       {
#  187|->       err = b64enc_write (&state, buffer, nread);
#  188|         if (err)
#  189|           fail (2);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
gnupg-2.4.9/common/t-b64.c:192:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
gnupg-2.4.9/common/t-b64.c:173:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:173:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:173:16: acquire_resource: opened here
gnupg-2.4.9/common/t-b64.c:174:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:181:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:192:9: throw: if ‘b64enc_finish’ throws an exception...
gnupg-2.4.9/common/t-b64.c:192:9: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  190|       }
#  191|   
#  192|->   err = b64enc_finish (&state);
#  193|     if (err)
#  194|       fail (3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
gnupg-2.4.9/common/t-b64.c:192:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
gnupg-2.4.9/common/t-b64.c:173:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:173:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:173:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:174:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:181:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:192:9: throw: if ‘b64enc_finish’ throws an exception...
gnupg-2.4.9/common/t-b64.c:192:9: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  190|       }
#  191|   
#  192|->   err = b64enc_finish (&state);
#  193|     if (err)
#  194|       fail (3);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
gnupg-2.4.9/common/t-b64.c:218:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
gnupg-2.4.9/common/t-b64.c:210:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:210:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:210:16: acquire_resource: opened here
gnupg-2.4.9/common/t-b64.c:211:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:218:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:218:9: throw: if ‘b64dec_start’ throws an exception...
gnupg-2.4.9/common/t-b64.c:218:9: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  216|       }
#  217|   
#  218|->   err = b64dec_start (&state, "");
#  219|     if (err)
#  220|       fail (1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
gnupg-2.4.9/common/t-b64.c:218:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
gnupg-2.4.9/common/t-b64.c:210:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:210:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:210:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:211:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:218:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:218:9: throw: if ‘b64dec_start’ throws an exception...
gnupg-2.4.9/common/t-b64.c:218:9: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  216|       }
#  217|   
#  218|->   err = b64dec_start (&state, "");
#  219|     if (err)
#  220|       fail (1);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def88]
gnupg-2.4.9/common/t-b64.c:222:20: warning[-Wanalyzer-null-argument]: use of NULL ‘fp’ where non-null expected
gnupg-2.4.9/common/t-b64.c:210:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:210:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:210:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:211:6: release_memory: assuming ‘fp’ is NULL
gnupg-2.4.9/common/t-b64.c:211:6: branch_true: following ‘true’ branch (when ‘fp’ is NULL)...
gnupg-2.4.9/common/t-b64.c:214:70: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:213:7: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:213:7: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:222:20: danger: argument 4 (‘fp’) NULL where non-null expected
#  220|       fail (1);
#  221|   
#  222|->   while ( (nread = fread (buffer, 1, sizeof buffer, fp)) )
#  223|       {
#  224|         err = b64dec_proc (&state, buffer, nread, &nbytes);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def89]
gnupg-2.4.9/common/t-b64.c:224:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
gnupg-2.4.9/common/t-b64.c:210:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:210:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:210:16: acquire_resource: opened here
gnupg-2.4.9/common/t-b64.c:211:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:218:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:222:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-b64.c:224:13: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:224:13: throw: if ‘b64dec_proc’ throws an exception...
gnupg-2.4.9/common/t-b64.c:224:13: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  222|     while ( (nread = fread (buffer, 1, sizeof buffer, fp)) )
#  223|       {
#  224|->       err = b64dec_proc (&state, buffer, nread, &nbytes);
#  225|         if (err)
#  226|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
gnupg-2.4.9/common/t-b64.c:224:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
gnupg-2.4.9/common/t-b64.c:210:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:210:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:210:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:211:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:218:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:222:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-b64.c:224:13: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:224:13: throw: if ‘b64dec_proc’ throws an exception...
gnupg-2.4.9/common/t-b64.c:224:13: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  222|     while ( (nread = fread (buffer, 1, sizeof buffer, fp)) )
#  223|       {
#  224|->       err = b64dec_proc (&state, buffer, nread, &nbytes);
#  225|         if (err)
#  226|           {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
gnupg-2.4.9/common/t-b64.c:235:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
gnupg-2.4.9/common/t-b64.c:210:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:210:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:210:16: acquire_resource: opened here
gnupg-2.4.9/common/t-b64.c:211:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:218:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:235:9: throw: if ‘b64dec_finish’ throws an exception...
gnupg-2.4.9/common/t-b64.c:235:9: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  233|       }
#  234|   
#  235|->   err = b64dec_finish (&state);
#  236|     if (err)
#  237|       fail (3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
gnupg-2.4.9/common/t-b64.c:235:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
gnupg-2.4.9/common/t-b64.c:210:8: branch_true: following ‘true’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:210:16: branch_true: ...to here
gnupg-2.4.9/common/t-b64.c:210:16: acquire_memory: allocated here
gnupg-2.4.9/common/t-b64.c:211:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/common/t-b64.c:218:9: branch_false: ...to here
gnupg-2.4.9/common/t-b64.c:235:9: throw: if ‘b64dec_finish’ throws an exception...
gnupg-2.4.9/common/t-b64.c:235:9: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  233|       }
#  234|   
#  235|->   err = b64dec_finish (&state);
#  236|     if (err)
#  237|       fail (3);

Error: COMPILER_WARNING (CWE-252): [#def93]
gnupg-2.4.9/common/t-exechelp.c: scope_hint: In function ‘test_close_all_fds’
gnupg-2.4.9/common/t-exechelp.c:96:3: warning[-Wunused-result]: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’
#   96 |   dup (1);
#      |   ^~~~~~~
#   94|   
#   95|     /* Some dups to get more file descriptors and close one. */
#   96|->   dup (1);
#   97|     dup (1);
#   98|     fd = dup (1);

Error: COMPILER_WARNING (CWE-252): [#def94]
gnupg-2.4.9/common/t-exechelp.c:97:3: warning[-Wunused-result]: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’
#   97 |   dup (1);
#      |   ^~~~~~~
#   95|     /* Some dups to get more file descriptors and close one. */
#   96|     dup (1);
#   97|->   dup (1);
#   98|     fd = dup (1);
#   99|     dup (1);

Error: COMPILER_WARNING (CWE-252): [#def95]
gnupg-2.4.9/common/t-exechelp.c:99:3: warning[-Wunused-result]: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’
#   99 |   dup (1);
#      |   ^~~~~~~
#   97|     dup (1);
#   98|     fd = dup (1);
#   99|->   dup (1);
#  100|     close (fd);
#  101|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
gnupg-2.4.9/common/t-exechelp.c:100:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
gnupg-2.4.9/common/t-exechelp.c:175:1: enter_function: entry to ‘main’
gnupg-2.4.9/common/t-exechelp.c:185:3: call_function: calling ‘test_close_all_fds’ from ‘main’
#   98|     fd = dup (1);
#   99|     dup (1);
#  100|->   close (fd);
#  101|   
#  102|     array = xget_all_open_fds ();

Error: COMPILER_WARNING (CWE-252): [#def97]
gnupg-2.4.9/common/t-exechelp.c:140:9: warning[-Wunused-result]: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’
#  140 |         dup (1);
#      |         ^~~~~~~
#  138|   
#  139|         for (n=initial_count; n < 31; n++)
#  140|->         dup (1);
#  141|         array = xget_all_open_fds ();
#  142|         if (verbose)

Error: COMPILER_WARNING (CWE-252): [#def98]
gnupg-2.4.9/common/t-exechelp.c:147:11: warning[-Wunused-result]: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’
#  147 |           dup (1);
#      |           ^~~~~~~
#  145|         for (n=0; n < 5; n++)
#  146|           {
#  147|->           dup (1);
#  148|             array = xget_all_open_fds ();
#  149|             if (verbose)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
gnupg-2.4.9/common/t-exectool.c:197:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
gnupg-2.4.9/common/t-exectool.c:146:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-exectool.c:153:18: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:154:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-exectool.c:161:9: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:162:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/common/t-exectool.c:169:19: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:171:3: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-exectool.c:173:15: branch_true: ...to here
gnupg-2.4.9/common/t-exectool.c:173:15: acquire_memory: allocated here
gnupg-2.4.9/common/t-exectool.c:174:3: branch_true: following ‘true’ branch (when ‘reference’ is non-NULL)...
gnupg-2.4.9/common/t-exectool.c:174:3: branch_true: ...to here
gnupg-2.4.9/common/t-exectool.c:176:23: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-exectool.c:192:3: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:197:9: throw: if ‘gnupg_exec_tool’ throws an exception...
gnupg-2.4.9/common/t-exectool.c:197:9: danger: ‘p’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  195|       fprintf (stderr, "Executing %s %s...\n", argv[0], argv[1]);
#  196|   
#  197|->   err = gnupg_exec_tool (argv[0], &argv[1], "", &result, &len);
#  198|     if (err)
#  199|       fail ("gnupg_exec_tool", err);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
gnupg-2.4.9/common/t-exectool.c:199:5: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
gnupg-2.4.9/common/t-exectool.c:146:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-exectool.c:153:18: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:154:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-exectool.c:161:9: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:162:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/common/t-exectool.c:169:19: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:171:3: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-exectool.c:173:15: branch_true: ...to here
gnupg-2.4.9/common/t-exectool.c:173:15: acquire_memory: allocated here
gnupg-2.4.9/common/t-exectool.c:174:3: branch_true: following ‘true’ branch (when ‘reference’ is non-NULL)...
gnupg-2.4.9/common/t-exectool.c:174:3: branch_true: ...to here
gnupg-2.4.9/common/t-exectool.c:176:23: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-exectool.c:192:3: branch_false: ...to here
gnupg-2.4.9/common/t-exectool.c:198:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-exectool.c:199:5: branch_true: ...to here
gnupg-2.4.9/common/t-exectool.c:199:5: throw: if ‘gpg_strerror’ throws an exception...
gnupg-2.4.9/common/t-exectool.c:199:5: danger: ‘p’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  197|     err = gnupg_exec_tool (argv[0], &argv[1], "", &result, &len);
#  198|     if (err)
#  199|->     fail ("gnupg_exec_tool", err);
#  200|   
#  201|     assert (result);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def101]
gnupg-2.4.9/common/t-iobuf.c:91:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘state’
gnupg-2.4.9/common/t-iobuf.c:89:7: acquire_memory: this call could return NULL
gnupg-2.4.9/common/t-iobuf.c:91:3: danger: ‘state’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   89|       = malloc (sizeof (struct content_filter_state));
#   90|   
#   91|->   state->pos = 0;
#   92|     state->len = strlen (buffer);
#   93|     state->buffer = buffer;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
gnupg-2.4.9/common/t-ssh-utils.c:224:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "rb")’
gnupg-2.4.9/common/t-ssh-utils.c:216:8: acquire_resource: opened here
gnupg-2.4.9/common/t-ssh-utils.c:217:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:224:7: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:224:6: danger: ‘fopen(fname, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  222|       }
#  223|   
#  224|->   if (fstat (fileno(fp), &st))
#  225|       {
#  226|         fprintf (stderr, "%s:%d: can't stat '%s': %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
gnupg-2.4.9/common/t-ssh-utils.c:224:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "rb")’
gnupg-2.4.9/common/t-ssh-utils.c:216:8: acquire_memory: allocated here
gnupg-2.4.9/common/t-ssh-utils.c:217:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:224:7: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:224:6: danger: ‘fopen(fname, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  222|       }
#  223|   
#  224|->   if (fstat (fileno(fp), &st))
#  225|       {
#  226|         fprintf (stderr, "%s:%d: can't stat '%s': %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
gnupg-2.4.9/common/t-ssh-utils.c:231:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "rb")’
gnupg-2.4.9/common/t-ssh-utils.c:216:8: acquire_resource: opened here
gnupg-2.4.9/common/t-ssh-utils.c:217:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:224:7: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:224:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:231:12: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:232:9: throw: if ‘gcry_xmalloc’ throws an exception...
gnupg-2.4.9/common/t-ssh-utils.c:231:12: danger: ‘fopen(fname, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  229|       }
#  230|   
#  231|->   buflen = st.st_size;
#  232|     buf = xmalloc (buflen+1);
#  233|     if (fread (buf, buflen, 1, fp) != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
gnupg-2.4.9/common/t-ssh-utils.c:231:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "rb")’
gnupg-2.4.9/common/t-ssh-utils.c:216:8: acquire_memory: allocated here
gnupg-2.4.9/common/t-ssh-utils.c:217:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:224:7: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:224:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:231:12: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:232:9: throw: if ‘gcry_xmalloc’ throws an exception...
gnupg-2.4.9/common/t-ssh-utils.c:231:12: danger: ‘fopen(fname, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  229|       }
#  230|   
#  231|->   buflen = st.st_size;
#  232|     buf = xmalloc (buflen+1);
#  233|     if (fread (buf, buflen, 1, fp) != 1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
gnupg-2.4.9/common/t-ssh-utils.c:311:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(xtryasprintf("%s.key.%d", bin2hex(&grip, 20, 0), idx), "w")’
gnupg-2.4.9/common/t-ssh-utils.c:284:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:285:17: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:292:15: branch_true: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:295:12: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:301:19: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:304:13: acquire_resource: opened here
gnupg-2.4.9/common/t-ssh-utils.c:305:12: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:311:9: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:311:9: throw: if ‘gcry_free’ throws an exception...
gnupg-2.4.9/common/t-ssh-utils.c:311:9: danger: ‘fopen(xtryasprintf("%s.key.%d", bin2hex(&grip, 20, 0), idx), "w")’ leaks here; was opened at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  309|   	    exit (1);
#  310|   	  }
#  311|-> 	xfree (name);
#  312|   	fprintf (s, "%s", sample_keys[idx].key);
#  313|   	fclose (s);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
gnupg-2.4.9/common/t-ssh-utils.c:311:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(xtryasprintf("%s.key.%d", bin2hex(&grip, 20, 0), idx), "w")’
gnupg-2.4.9/common/t-ssh-utils.c:284:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:285:17: branch_true: following ‘true’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:292:15: branch_true: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:295:12: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:301:19: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:304:13: acquire_memory: allocated here
gnupg-2.4.9/common/t-ssh-utils.c:305:12: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-ssh-utils.c:311:9: branch_false: ...to here
gnupg-2.4.9/common/t-ssh-utils.c:311:9: throw: if ‘gcry_free’ throws an exception...
gnupg-2.4.9/common/t-ssh-utils.c:311:9: danger: ‘fopen(xtryasprintf("%s.key.%d", bin2hex(&grip, 20, 0), idx), "w")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  309|   	    exit (1);
#  310|   	  }
#  311|-> 	xfree (name);
#  312|   	fprintf (s, "%s", sample_keys[idx].key);
#  313|   	fclose (s);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def108]
gnupg-2.4.9/common/t-zb32.c:171:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "rb")’
gnupg-2.4.9/common/t-zb32.c:118:6: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-zb32.c:155:12: branch_false: ...to here
gnupg-2.4.9/common/t-zb32.c:155:12: acquire_resource: opened here
gnupg-2.4.9/common/t-zb32.c:156:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-zb32.c:163:11: branch_false: ...to here
gnupg-2.4.9/common/t-zb32.c:163:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-zb32.c:171:16: branch_false: ...to here
gnupg-2.4.9/common/t-zb32.c:172:13: throw: if ‘gcry_xmalloc’ throws an exception...
gnupg-2.4.9/common/t-zb32.c:171:16: danger: ‘fopen(fname, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  169|           }
#  170|   
#  171|->       buflen = st.st_size;
#  172|         buf = xmalloc (buflen+1);
#  173|         if (fread (buf, buflen, 1, fp) != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
gnupg-2.4.9/common/t-zb32.c:171:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "rb")’
gnupg-2.4.9/common/t-zb32.c:118:6: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/common/t-zb32.c:155:12: branch_false: ...to here
gnupg-2.4.9/common/t-zb32.c:155:12: acquire_memory: allocated here
gnupg-2.4.9/common/t-zb32.c:156:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-zb32.c:163:11: branch_false: ...to here
gnupg-2.4.9/common/t-zb32.c:163:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/common/t-zb32.c:171:16: branch_false: ...to here
gnupg-2.4.9/common/t-zb32.c:172:13: throw: if ‘gcry_xmalloc’ throws an exception...
gnupg-2.4.9/common/t-zb32.c:171:16: danger: ‘fopen(fname, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  169|           }
#  170|   
#  171|->       buflen = st.st_size;
#  172|         buf = xmalloc (buflen+1);
#  173|         if (fread (buf, buflen, 1, fp) != 1)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def110]
gnupg-2.4.9/common/ttyio.c:288:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/ttyio.c:645:1: enter_function: entry to ‘tty_get_hidden’
gnupg-2.4.9/common/ttyio.c:647:10: call_function: calling ‘do_get’ from ‘tty_get_hidden’
#  286|   #else /* Unix */
#  287|     last_prompt_len += vfprintf (ttyfp, fmt, arg_ptr) ;
#  288|->   fflush (ttyfp);
#  289|   #endif /* Unix */
#  290|     va_end(arg_ptr);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def111]
gnupg-2.4.9/common/ttyio.c:635:7: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/ttyio.c:634:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/ttyio.c:635:7: throw: if ‘gpgrt_vasprintf’ throws an exception...
gnupg-2.4.9/common/ttyio.c:635:7: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  633|   
#  634|     va_start (arg_ptr, promptfmt);
#  635|->   if (gpgrt_vasprintf (&prompt, promptfmt, arg_ptr) < 0)
#  636|       log_fatal ("estream_vasprintf failed: %s\n", strerror (errno));
#  637|     va_end (arg_ptr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
gnupg-2.4.9/common/utf8conv.c:631:14: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open(active_charset_name, "utf-8")’
gnupg-2.4.9/common/utf8conv.c:429:12: branch_false: following ‘false’ branch (when ‘slen == 0’)...
gnupg-2.4.9/common/utf8conv.c:615:10: branch_false: ...to here
gnupg-2.4.9/common/utf8conv.c:615:10: branch_true: following ‘true’ branch (when ‘buffer’ is NULL)...
gnupg-2.4.9/common/utf8conv.c:618:24: branch_true: ...to here
gnupg-2.4.9/common/utf8conv.c:429:12: branch_false: following ‘false’ branch (when ‘slen == 0’)...
gnupg-2.4.9/common/utf8conv.c:615:10: branch_false: ...to here
gnupg-2.4.9/common/utf8conv.c:615:10: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
gnupg-2.4.9/common/utf8conv.c:620:15: branch_false: ...to here
gnupg-2.4.9/common/utf8conv.c:620:15: branch_true: following ‘true’ branch (when ‘with_iconv != 0’)...
gnupg-2.4.9/common/utf8conv.c:628:11: branch_true: ...to here
gnupg-2.4.9/common/utf8conv.c:630:16: acquire_memory: allocated here
gnupg-2.4.9/common/utf8conv.c:631:14: danger: ‘iconv_open(active_charset_name, "utf-8")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  629|   
#  630|             cd = iconv_open (active_charset_name, "utf-8");
#  631|->           if (cd == (iconv_t)-1)
#  632|               {
#  633|                 handle_iconv_error (active_charset_name, "utf-8", 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
gnupg-2.4.9/common/utf8conv.c:640:15: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open(active_charset_name, "utf-8")’
gnupg-2.4.9/common/utf8conv.c:615:10: branch_true: following ‘true’ branch (when ‘buffer’ is NULL)...
gnupg-2.4.9/common/utf8conv.c:618:24: branch_true: ...to here
gnupg-2.4.9/common/utf8conv.c:429:12: branch_false: following ‘false’ branch (when ‘slen == 0’)...
gnupg-2.4.9/common/utf8conv.c:615:10: branch_false: ...to here
gnupg-2.4.9/common/utf8conv.c:620:15: branch_true: following ‘true’ branch (when ‘with_iconv != 0’)...
gnupg-2.4.9/common/utf8conv.c:628:11: branch_true: ...to here
gnupg-2.4.9/common/utf8conv.c:630:16: acquire_memory: allocated here
gnupg-2.4.9/common/utf8conv.c:640:15: danger: ‘iconv_open(active_charset_name, "utf-8")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  638|             /* Allocate a new buffer large enough to hold all possible
#  639|                encodings. */
#  640|->           n = p - buffer + 1;
#  641|             inbytes = n - 1;;
#  642|             inptr = buffer;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def114]
gnupg-2.4.9/common/w32-cmdline.c:281:14: warning[-Wanalyzer-deref-before-check]: check of ‘p0’ for NULL after already dereferencing it
gnupg-2.4.9/common/w32-cmdline.c:345:1: enter_function: entry to ‘w32_parse_commandline’
gnupg-2.4.9/common/w32-cmdline.c:355:10: call_function: calling ‘parse_cmdstring’ from ‘w32_parse_commandline’
#  279|         else if (*p == '\\' && (n=count_backslashes (p)))
#  280|           {
#  281|->           if (!p0) /* First non-WS; set start.  */
#  282|               p0 = p;
#  283|             if (p[n] == '"')

Error: GCC_ANALYZER_WARNING (CWE-465): [#def115]
gnupg-2.4.9/common/w32-cmdline.c:299:14: warning[-Wanalyzer-deref-before-check]: check of ‘p0’ for NULL after already dereferencing it
gnupg-2.4.9/common/w32-cmdline.c:345:1: enter_function: entry to ‘w32_parse_commandline’
gnupg-2.4.9/common/w32-cmdline.c:355:10: call_function: calling ‘parse_cmdstring’ from ‘w32_parse_commandline’
#  297|         else if (*p == ' ' || *p == '\t')
#  298|           {
#  299|->           if (p0) /* We are in an argument and reached WS.  */
#  300|               {
#  301|                 if (argv)

Error: GCC_ANALYZER_WARNING (CWE-465): [#def116]
gnupg-2.4.9/common/w32-cmdline.c:313:15: warning[-Wanalyzer-deref-before-check]: check of ‘p0’ for NULL after already dereferencing it
gnupg-2.4.9/common/w32-cmdline.c:345:1: enter_function: entry to ‘w32_parse_commandline’
gnupg-2.4.9/common/w32-cmdline.c:355:10: call_function: calling ‘parse_cmdstring’ from ‘w32_parse_commandline’
#  311|               }
#  312|           }
#  313|->       else if (!p0) /* First non-WS; set start.  */
#  314|           p0 = p;
#  315|       }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def117]
gnupg-2.4.9/common/xasprintf.c:50:7: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/xasprintf.c:49:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/xasprintf.c:50:7: throw: if ‘gpgrt_vasprintf’ throws an exception...
gnupg-2.4.9/common/xasprintf.c:50:7: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   48|   
#   49|     va_start (ap, fmt);
#   50|->   if (gpgrt_vasprintf (&buf, fmt, ap) < 0)
#   51|       log_fatal ("estream_asprintf failed: %s\n", strerror (errno));
#   52|     va_end (ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def118]
gnupg-2.4.9/common/xasprintf.c:65:8: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/common/xasprintf.c:64:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/common/xasprintf.c:65:8: throw: if ‘gpgrt_vasprintf’ throws an exception...
gnupg-2.4.9/common/xasprintf.c:65:8: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   63|   
#   64|     va_start (ap, fmt);
#   65|->   rc = gpgrt_vasprintf (&buf, fmt, ap);
#   66|     va_end (ap);
#   67|     if (rc < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def119]
gnupg-2.4.9/dirmngr/dirmngr-client.c:819:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fname’
gnupg-2.4.9/dirmngr/dirmngr-client.c:797:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/dirmngr-client.c:802:15: branch_false: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:802:15: acquire_memory: allocated here
gnupg-2.4.9/dirmngr/dirmngr-client.c:803:10: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/dirmngr/dirmngr-client.c:812:11: branch_false: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:812:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/dirmngr-client.c:819:10: branch_false: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:819:10: throw: if ‘gcry_xmalloc’ throws an exception...
gnupg-2.4.9/dirmngr/dirmngr-client.c:819:10: danger: ‘fname’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  817|       }
#  818|   
#  819|->   line = xmalloc (8 + 6 + strlen (fname) * 3 + 1);
#  820|     p = stpcpy (line, "LOADCRL ");
#  821|     if (opt.url)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
gnupg-2.4.9/dirmngr/dirmngr-client.c:845:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fname’
gnupg-2.4.9/dirmngr/dirmngr-client.c:797:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/dirmngr-client.c:802:15: branch_false: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:802:15: acquire_memory: allocated here
gnupg-2.4.9/dirmngr/dirmngr-client.c:803:10: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
gnupg-2.4.9/dirmngr/dirmngr-client.c:812:11: branch_false: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:812:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/dirmngr/dirmngr-client.c:814:22: branch_true: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:845:1: danger: ‘fname’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  843|     xfree (fname);
#  844|     return err;
#  845|-> }
#  846|   
#  847|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def121]
gnupg-2.4.9/dirmngr/dirmngr-client.c:921:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘certbuf’
gnupg-2.4.9/dirmngr/dirmngr-client.c:904:1: enter_function: entry to ‘squid_loop_body’
gnupg-2.4.9/dirmngr/dirmngr-client.c:910:9: call_function: calling ‘read_pem_certificate’ from ‘squid_loop_body’
gnupg-2.4.9/dirmngr/dirmngr-client.c:910:9: return_function: returning to ‘squid_loop_body’ from ‘read_pem_certificate’
gnupg-2.4.9/dirmngr/dirmngr-client.c:911:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/dirmngr-client.c:913:6: branch_false: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:913:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/dirmngr-client.c:921:9: branch_false: ...to here
gnupg-2.4.9/dirmngr/dirmngr-client.c:921:9: danger: use of uninitialized value ‘certbuf’ here
#  919|       }
#  920|   
#  921|->   err = do_check (ctx, certbuf, certbuflen);
#  922|     xfree (certbuf);
#  923|     if (!err)

Error: COMPILER_WARNING (CWE-704): [#def122]
gnupg-2.4.9/dirmngr/dirmngr.c: scope_hint: In function ‘handle_connections’
gnupg-2.4.9/dirmngr/dirmngr.c:2360:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 2360 |       char *slash = strrchr (socket_name, '/');
#      |                     ^~~~~~~
# 2358|         /* We need to watch the directory for the file because there
# 2359|          * won't be an IN_DELETE_SELF for a socket file.  */
# 2360|->       char *slash = strrchr (socket_name, '/');
# 2361|         log_assert (slash && slash[1]);
# 2362|         *slash = 0;

Error: COMPILER_WARNING (CWE-704): [#def123]
gnupg-2.4.9/dirmngr/dirmngr.c:2360:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 2358|         /* We need to watch the directory for the file because there
# 2359|          * won't be an IN_DELETE_SELF for a socket file.  */
# 2360|->       char *slash = strrchr (socket_name, '/');
# 2361|         log_assert (slash && slash[1]);
# 2362|         *slash = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def124]
gnupg-2.4.9/dirmngr/dns-stuff.c:1700:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘r_keylen’
gnupg-2.4.9/dirmngr/dns-stuff.c:1818:1: enter_function: entry to ‘get_dns_cert’
gnupg-2.4.9/dirmngr/dns-stuff.c:1824:6: branch_true: following ‘true’ branch (when ‘r_key’ is non-NULL)...
gnupg-2.4.9/dirmngr/dns-stuff.c:1825:5: branch_true: ...to here
gnupg-2.4.9/dirmngr/dns-stuff.c:1826:6: branch_false: following ‘false’ branch (when ‘r_keylen’ is NULL)...
gnupg-2.4.9/dirmngr/dns-stuff.c:1828:3: branch_false: ...to here
gnupg-2.4.9/dirmngr/dns-stuff.c:1828:3: release_memory: ‘r_keylen’ is NULL
gnupg-2.4.9/dirmngr/dns-stuff.c:1833:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/dns-stuff.c:1843:11: branch_false: ...to here
gnupg-2.4.9/dirmngr/dns-stuff.c:1843:11: call_function: calling ‘get_dns_cert_standard’ from ‘get_dns_cert’
# 1698|                   {
# 1699|                     memcpy (*r_key, pt, dlen);
# 1700|->                   *r_keylen = dlen;
# 1701|                     err = 0;
# 1702|                   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def125]
gnupg-2.4.9/dirmngr/dns-stuff.c:2149:3: warning[-Wanalyzer-null-argument]: use of NULL ‘*list’ where non-null expected
gnupg-2.4.9/dirmngr/dns-stuff.c:2101:1: enter_function: entry to ‘get_dns_srv’
gnupg-2.4.9/dirmngr/dns-stuff.c:2110:3: release_memory: ‘*list’ is NULL
gnupg-2.4.9/dirmngr/dns-stuff.c:2115:6: branch_false: following ‘false’ branch (when ‘service’ is NULL)...
gnupg-2.4.9/dirmngr/dns-stuff.c:2129:7: branch_false: ...to here
gnupg-2.4.9/dirmngr/dns-stuff.c:2129:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/dns-stuff.c:2137:11: branch_false: ...to here
gnupg-2.4.9/dirmngr/dns-stuff.c:2137:11: call_function: calling ‘getsrv_standard’ from ‘get_dns_srv’
gnupg-2.4.9/dirmngr/dns-stuff.c:2137:11: return_function: returning to ‘get_dns_srv’ from ‘getsrv_standard’
gnupg-2.4.9/dirmngr/dns-stuff.c:2139:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/dirmngr/dns-stuff.c:2149:3: branch_false: ...to here
gnupg-2.4.9/dirmngr/dns-stuff.c:2149:3: release_memory: ‘*list’ is NULL
gnupg-2.4.9/dirmngr/dns-stuff.c:2149:3: danger: argument 1 (‘*list’) NULL where non-null expected
# 2147|   
# 2148|     /* Order by priority */
# 2149|->   qsort(*list,srvcount,sizeof(struct srventry),priosort);
# 2150|   
# 2151|     /* For each priority, move the zero-weighted items first. */

Error: CPPCHECK_WARNING (CWE-457): [#def126]
gnupg-2.4.9/dirmngr/dns.c:4505: error[uninitvar]: Uninitialized variable: &src
# 4503|   		return t->print(_dst, lim, any);
# 4504|   
# 4505|-> 	dns_b_from(&src, any->rdata.data, any->rdata.len);
# 4506|   	dns_b_into(&dst, _dst, lim);
# 4507|   

Error: CPPCHECK_WARNING (CWE-909): [#def127]
gnupg-2.4.9/dirmngr/dns.c:4510: error[uninitStructMember]: Uninitialized struct member: src.p
# 4508|   	dns_b_putc(&dst, '"');
# 4509|   
# 4510|-> 	while (src.p < src.pe) {
# 4511|   		dns_b_putc(&dst, '\\');
# 4512|   		dns_b_fmtju(&dst, *src.p++, 3);

Error: CPPCHECK_WARNING (CWE-909): [#def128]
gnupg-2.4.9/dirmngr/dns.c:4510: error[uninitStructMember]: Uninitialized struct member: src.pe
# 4508|   	dns_b_putc(&dst, '"');
# 4509|   
# 4510|-> 	while (src.p < src.pe) {
# 4511|   		dns_b_putc(&dst, '\\');
# 4512|   		dns_b_fmtju(&dst, *src.p++, 3);

Error: CPPCHECK_WARNING (CWE-909): [#def129]
gnupg-2.4.9/dirmngr/dns.c:4512: error[uninitStructMember]: Uninitialized struct member: src.p
# 4510|   	while (src.p < src.pe) {
# 4511|   		dns_b_putc(&dst, '\\');
# 4512|-> 		dns_b_fmtju(&dst, *src.p++, 3);
# 4513|   	}
# 4514|   

Error: CPPCHECK_WARNING (CWE-786): [#def130]
gnupg-2.4.9/dirmngr/dns.c:7658: error[negativeIndex]: Array 'so->query->data[1]' accessed at index -2, which is out of bounds.
# 7656|   	size_t n;
# 7657|   
# 7658|-> 	so->query->data[-2] = 0xff & (so->query->end >> 8);
# 7659|   	so->query->data[-1] = 0xff & (so->query->end >> 0);
# 7660|   

Error: CPPCHECK_WARNING (CWE-786): [#def131]
gnupg-2.4.9/dirmngr/dns.c:7659: error[negativeIndex]: Array 'so->query->data[1]' accessed at index -1, which is out of bounds.
# 7657|   
# 7658|   	so->query->data[-2] = 0xff & (so->query->end >> 8);
# 7659|-> 	so->query->data[-1] = 0xff & (so->query->end >> 0);
# 7660|   
# 7661|   	qend = so->query->end + 2;

Error: CPPCHECK_WARNING (CWE-786): [#def132]
gnupg-2.4.9/dirmngr/dns.c:7664: error[negativeIndex]: Array 'so->query->data[1]' accessed at index -2, which is out of bounds.
# 7662|   
# 7663|   	while (so->qout < qend) {
# 7664|-> 		qsrc = &so->query->data[-2] + so->qout;
# 7665|   		n = dns_send_nopipe(so->tcp, (void *)qsrc, qend - so->qout, 0, &error);
# 7666|   		dns_trace_sys_send(so->trace, so->tcp, SOCK_STREAM, qsrc, n, error);

Error: CPPCHECK_WARNING (CWE-786): [#def133]
gnupg-2.4.9/dirmngr/dns.c:7687: error[negativeIndex]: Array 'so->answer->data[1]' accessed at index -2, which is out of bounds.
# 7685|   
# 7686|   	while (so->apos < aend) {
# 7687|-> 		asrc = &so->answer->data[-2];
# 7688|   
# 7689|   		n = dns_recv(so->tcp, (void *)&asrc[so->apos], aend - so->apos, 0, &error);

Error: CPPCHECK_WARNING (CWE-786): [#def134]
gnupg-2.4.9/dirmngr/dns.c:7698: error[negativeIndex]: Array 'so->answer->data[1]' accessed at index -2, which is out of bounds.
# 7696|   
# 7697|   		if (so->alen == 0 && so->apos >= 2) {
# 7698|-> 			alen = ((0xff & so->answer->data[-2]) << 8)
# 7699|   			     | ((0xff & so->answer->data[-1]) << 0);
# 7700|   

Error: CPPCHECK_WARNING (CWE-786): [#def135]
gnupg-2.4.9/dirmngr/dns.c:7699: error[negativeIndex]: Array 'so->answer->data[1]' accessed at index -1, which is out of bounds.
# 7697|   		if (so->alen == 0 && so->apos >= 2) {
# 7698|   			alen = ((0xff & so->answer->data[-2]) << 8)
# 7699|-> 			     | ((0xff & so->answer->data[-1]) << 0);
# 7700|   
# 7701|   			if ((error = dns_so_newanswer(so, alen)))

Error: GCC_ANALYZER_WARNING (CWE-457): [#def136]
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3207:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘serverinfo’
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3012:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3015:6: branch_false: ...to here
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3018:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3018:7: branch_true: ...to here
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3018:7: branch_true: following ‘true’ branch (when ‘filter_arg’ is non-NULL)...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3019:24: branch_true: ...to here
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3018:7: branch_true: following ‘true’ branch...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3021:27: branch_true: ...to here
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3022:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3024:17: branch_true: ...to here
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3199:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3201:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3202:7: branch_false: ...to here
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3204:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3205:7: branch_false: ...to here
gnupg-2.4.9/dirmngr/ks-engine-ldap.c:3207:7: danger: use of uninitialized value ‘serverinfo’ here
# 3205|         ctrl->ks_get_state->message = message;
# 3206|         message = NULL;
# 3207|->       ctrl->ks_get_state->serverinfo = serverinfo;
# 3208|         ctrl->ks_get_state->scope = scope;
# 3209|         ctrl->ks_get_state->basedn = basedn;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def137]
gnupg-2.4.9/dirmngr/server.c:3284:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/dirmngr/server.c:3280:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/dirmngr/server.c:3282:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/dirmngr/server.c:3284:13: throw: if ‘vprint_assuan_status_strings’ throws an exception...
gnupg-2.4.9/dirmngr/server.c:3284:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 3282|     if (ctrl->server_local && (ctx = ctrl->server_local->assuan_ctx))
# 3283|       {
# 3284|->       err = vprint_assuan_status_strings (ctx, keyword, arg_ptr);
# 3285|       }
# 3286|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def138]
gnupg-2.4.9/dirmngr/server.c:3365:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/dirmngr/server.c:3361:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/dirmngr/server.c:3364:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/dirmngr/server.c:3365:9: throw: if ‘vprint_assuan_status’ throws an exception...
gnupg-2.4.9/dirmngr/server.c:3365:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 3363|   
# 3364|     va_start (arg_ptr, format);
# 3365|->   err = vprint_assuan_status (ctx, keyword, format, arg_ptr);
# 3366|     va_end (arg_ptr);
# 3367|     return err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
gnupg-2.4.9/doc/mkdefsinc.c:223:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opt_date’
gnupg-2.4.9/doc/mkdefsinc.c:166:1: enter_function: entry to ‘main’
gnupg-2.4.9/doc/mkdefsinc.c:179:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/doc/mkdefsinc.c:182:10: branch_false: following ‘false’ branch (when the strings are non-equal)...
gnupg-2.4.9/doc/mkdefsinc.c:187:17: branch_false: ...to here
gnupg-2.4.9/doc/mkdefsinc.c:187:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
gnupg-2.4.9/doc/mkdefsinc.c:198:17: branch_false: ...to here
gnupg-2.4.9/doc/mkdefsinc.c:222:26: call_function: calling ‘xstrdup’ from ‘main’
gnupg-2.4.9/doc/mkdefsinc.c:222:26: return_function: returning to ‘main’ from ‘xstrdup’
gnupg-2.4.9/doc/mkdefsinc.c:179:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/doc/mkdefsinc.c:182:10: branch_false: following ‘false’ branch (when the strings are non-equal)...
gnupg-2.4.9/doc/mkdefsinc.c:187:17: branch_false: ...to here
gnupg-2.4.9/doc/mkdefsinc.c:187:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
gnupg-2.4.9/doc/mkdefsinc.c:198:17: branch_false: ...to here
gnupg-2.4.9/doc/mkdefsinc.c:222:26: call_function: calling ‘xstrdup’ from ‘main’
gnupg-2.4.9/doc/mkdefsinc.c:222:26: return_function: returning to ‘main’ from ‘xstrdup’
gnupg-2.4.9/doc/mkdefsinc.c:223:23: danger: ‘opt_date’ leaks here; was allocated at [(12)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/11)
#  221|               {
#  222|                 opt_date = xstrdup (*argv);
#  223|->               argc--; argv++;
#  224|               }
#  225|           }

Error: CPPCHECK_WARNING (CWE-457): [#def140]
gnupg-2.4.9/doc/mkdefsinc.c:337: warning[uninitvar]: Uninitialized variable: monthoff
#  335|   
#  336|     printf ("@set UPDATED %s\n", opt_date);
#  337|->   printf ("@set UPDATED-MONTH %s\n", opt_date + monthoff);
#  338|     printf ("@set EDITION %s\n", PACKAGE_VERSION);
#  339|     printf ("@set VERSION %s\n", PACKAGE_VERSION);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def141]
gnupg-2.4.9/g10/cpr.c:202:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/cpr.c:196:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/cpr.c:199:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/cpr.c:202:13: throw: if ‘get_status_string’ throws an exception...
gnupg-2.4.9/g10/cpr.c:202:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  200|   
#  201|     es_fputs ("[GNUPG:] ", statusfp);
#  202|->   es_fputs (get_status_string (no), statusfp);
#  203|     while ((s = va_arg (arg_ptr, const char*)))
#  204|       {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def142]
gnupg-2.4.9/g10/cpr.c:252:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/cpr.c:243:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/cpr.c:248:6: branch_true: following ‘true’ branch (when ‘format’ is non-NULL)...
gnupg-2.4.9/g10/cpr.c:250:7: branch_true: ...to here
gnupg-2.4.9/g10/cpr.c:251:7: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/cpr.c:252:13: throw: if ‘gpgrt_vbsprintf’ throws an exception...
gnupg-2.4.9/g10/cpr.c:252:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  250|         es_putc ( ' ', statusfp);
#  251|         va_start (arg_ptr, format);
#  252|->       buf = gpgrt_vbsprintf (format, arg_ptr);
#  253|         if (!buf)
#  254|           log_error ("error printing status line: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def143]
gnupg-2.4.9/g10/encrypt.c:607:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pt’
gnupg-2.4.9/g10/encrypt.c:420:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/encrypt.c:430:9: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:440:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/encrypt.c:446:6: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:446:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/encrypt.c:455:3: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:461:6: branch_false: following ‘false’ branch (when ‘mode == 0’)...
gnupg-2.4.9/g10/encrypt.c:516:48: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:516:8: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/encrypt.c:525:8: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:525:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/encrypt.c:531:8: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:531:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/encrypt.c:553:8: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:553:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/encrypt.c:566:9: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:587:6: branch_false: following ‘false’ branch (when ‘mode == 0’)...
gnupg-2.4.9/g10/encrypt.c:593:6: branch_false: ...to here
gnupg-2.4.9/g10/encrypt.c:604:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/encrypt.c:607:23: branch_true: ...to here
gnupg-2.4.9/g10/encrypt.c:607:7: danger: dereference of NULL ‘pt’
#  605|       {
#  606|         /* Note that PT has been initialized above in !no_literal mode.  */
#  607|->       pt->timestamp = make_timestamp();
#  608|         pt->mode = opt.mimemode? 'm' : opt.textmode? 't' : 'b';
#  609|         pt->len = filesize;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def144]
gnupg-2.4.9/g10/export.c:1754:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
gnupg-2.4.9/g10/export.c:1720:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/export.c:1725:13: branch_false: ...to here
gnupg-2.4.9/g10/export.c:1726:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/export.c:1731:3: branch_false: ...to here
gnupg-2.4.9/g10/export.c:1733:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/export.c:1739:8: branch_false: ...to here
gnupg-2.4.9/g10/export.c:1739:22: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:1741:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:1754:7: danger: dereference of NULL ‘domain’
# 1752|   
# 1753|         domain = strchr (mbox, '@');
# 1754|->       *domain++ = 0;
# 1755|   
# 1756|         if (1)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def145]
gnupg-2.4.9/g10/export.c:2581:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:11: throw: if ‘gcry_mpi_get_flag’ throws an exception...
gnupg-2.4.9/g10/export.c:2581:11: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 2579|     while ((a = va_arg (arg_ptr, gcry_mpi_t)))
# 2580|       {
# 2581|->       if (gcry_mpi_get_flag (a, GCRYMPI_FLAG_OPAQUE))
# 2582|           {
# 2583|             unsigned int nbits;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def146]
gnupg-2.4.9/g10/export.c:2586:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2586:15: throw: if ‘gcry_mpi_get_opaque’ throws an exception...
gnupg-2.4.9/g10/export.c:2586:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 2584|             const unsigned char *p;
# 2585|   
# 2586|->           p = gcry_mpi_get_opaque (a, &nbits);
# 2587|             buflen = (nbits + 7) / 8;
# 2588|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def147]
gnupg-2.4.9/g10/export.c:2593:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2589:14: branch_true: following ‘true’ branch (when the strings are equal)...
gnupg-2.4.9/g10/export.c:2589:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2589:15: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2593:15: throw: if ‘put_membuf’ throws an exception...
gnupg-2.4.9/g10/export.c:2593:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 2591|               {
# 2592|                 /* We need to strip our 0x40 prefix.  */
# 2593|->               put_membuf (mb, "\x00\x00\x00\x20", 4);
# 2594|                 put_membuf (mb, p+1, buflen-1);
# 2595|               }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def148]
gnupg-2.4.9/g10/export.c:2594:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2589:14: branch_true: following ‘true’ branch (when the strings are equal)...
gnupg-2.4.9/g10/export.c:2589:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2589:15: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2594:15: throw: if ‘put_membuf’ throws an exception...
gnupg-2.4.9/g10/export.c:2594:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 2592|                 /* We need to strip our 0x40 prefix.  */
# 2593|                 put_membuf (mb, "\x00\x00\x00\x20", 4);
# 2594|->               put_membuf (mb, p+1, buflen-1);
# 2595|               }
# 2596|             else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def149]
gnupg-2.4.9/g10/export.c:2601:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2601:15: throw: if ‘put_membuf’ throws an exception...
gnupg-2.4.9/g10/export.c:2601:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 2599|   
# 2600|                 c = buflen >> 24;
# 2601|->               put_membuf (mb, &c, 1);
# 2602|                 c = buflen >> 16;
# 2603|                 put_membuf (mb, &c, 1);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def150]
gnupg-2.4.9/g10/export.c:2603:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2603:15: throw: if ‘put_membuf’ throws an exception...
gnupg-2.4.9/g10/export.c:2603:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 2601|                 put_membuf (mb, &c, 1);
# 2602|                 c = buflen >> 16;
# 2603|->               put_membuf (mb, &c, 1);
# 2604|                 c = buflen >> 8;
# 2605|                 put_membuf (mb, &c, 1);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def151]
gnupg-2.4.9/g10/export.c:2605:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2605:15: throw: if ‘put_membuf’ throws an exception...
gnupg-2.4.9/g10/export.c:2605:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 2603|                 put_membuf (mb, &c, 1);
# 2604|                 c = buflen >> 8;
# 2605|->               put_membuf (mb, &c, 1);
# 2606|                 c = buflen;
# 2607|                 put_membuf (mb, &c, 1);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def152]
gnupg-2.4.9/g10/export.c:2607:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2607:15: throw: if ‘put_membuf’ throws an exception...
gnupg-2.4.9/g10/export.c:2607:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 2605|                 put_membuf (mb, &c, 1);
# 2606|                 c = buflen;
# 2607|->               put_membuf (mb, &c, 1);
# 2608|                 put_membuf (mb, p, buflen);
# 2609|               }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def153]
gnupg-2.4.9/g10/export.c:2608:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/export.c:2586:15: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2608:15: throw: if ‘put_membuf’ throws an exception...
gnupg-2.4.9/g10/export.c:2608:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 2606|                 c = buflen;
# 2607|                 put_membuf (mb, &c, 1);
# 2608|->               put_membuf (mb, p, buflen);
# 2609|               }
# 2610|           }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def154]
gnupg-2.4.9/g10/export.c:2613:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2578:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/export.c:2579:10: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
gnupg-2.4.9/g10/export.c:2581:11: branch_true: ...to here
gnupg-2.4.9/g10/export.c:2581:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/export.c:2613:17: branch_false: ...to here
gnupg-2.4.9/g10/export.c:2613:17: throw: if ‘gcry_mpi_aprint’ throws an exception...
gnupg-2.4.9/g10/export.c:2613:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 2611|         else
# 2612|           {
# 2613|->           err = gcry_mpi_aprint (GCRYMPI_FMT_SSH, &buf, &buflen, a);
# 2614|             if (err)
# 2615|               break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def155]
gnupg-2.4.9/g10/export.c:2616:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2626:1: enter_function: entry to ‘export_one_ssh_key’
gnupg-2.4.9/g10/export.c:2648:13: call_function: calling ‘key_to_sshblob’ from ‘export_one_ssh_key’
# 2614|             if (err)
# 2615|               break;
# 2616|->           put_membuf (mb, buf, buflen);
# 2617|             gcry_free (buf);
# 2618|           }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def156]
gnupg-2.4.9/g10/export.c:2617:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/export.c:2626:1: enter_function: entry to ‘export_one_ssh_key’
gnupg-2.4.9/g10/export.c:2648:13: call_function: calling ‘key_to_sshblob’ from ‘export_one_ssh_key’
# 2615|               break;
# 2616|             put_membuf (mb, buf, buflen);
# 2617|->           gcry_free (buf);
# 2618|           }
# 2619|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def157]
gnupg-2.4.9/g10/getkey.c:196:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pk’
gnupg-2.4.9/g10/getkey.c:4255:1: enter_function: entry to ‘get_user_id_string’
gnupg-2.4.9/g10/getkey.c:4261:3: branch_false: following ‘false’ branch (when ‘mode != 2’)...
gnupg-2.4.9/g10/getkey.c:4263:10: branch_false: ...to here
gnupg-2.4.9/g10/getkey.c:4264:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/getkey.c:4267:12: call_function: inlined call to ‘get_pubkey’ from ‘get_user_id_string’
#  194|       return;
#  195|   
#  196|->   if (is_ELGAMAL (pk->pubkey_algo)
#  197|         || pk->pubkey_algo == PUBKEY_ALGO_DSA
#  198|         || pk->pubkey_algo == PUBKEY_ALGO_ECDSA

Error: GCC_ANALYZER_WARNING (CWE-404): [#def158]
gnupg-2.4.9/g10/gpgsql.c:44:10: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/gpgsql.c:43:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/gpgsql.c:44:10: throw: if ‘sqlite3_vmprintf’ throws an exception...
gnupg-2.4.9/g10/gpgsql.c:44:10: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   42|   
#   43|     va_start (ap, sql);
#   44|->   sql2 = sqlite3_vmprintf (sql, ap);
#   45|     va_end (ap);
#   46|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def159]
gnupg-2.4.9/g10/gpgsql.c:137:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/gpgsql.c:90:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/gpgsql.c:125:10: branch_false: ...to here
gnupg-2.4.9/g10/gpgsql.c:126:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:129:19: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:131:11: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:137:23: throw: if ‘sqlite3_bind_int’ throws an exception...
gnupg-2.4.9/g10/gpgsql.c:137:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  135|                 {
#  136|                   int value = va_arg (va, int);
#  137|->                 err = sqlite3_bind_int (stmt, i, value);
#  138|                   break;
#  139|                 }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def160]
gnupg-2.4.9/g10/gpgsql.c:143:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/gpgsql.c:90:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/gpgsql.c:125:10: branch_false: ...to here
gnupg-2.4.9/g10/gpgsql.c:126:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:129:19: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:131:11: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:143:23: throw: if ‘sqlite3_bind_int64’ throws an exception...
gnupg-2.4.9/g10/gpgsql.c:143:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  141|                 {
#  142|                   long long value = va_arg (va, long long);
#  143|->                 err = sqlite3_bind_int64 (stmt, i, value);
#  144|                   break;
#  145|                 }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def161]
gnupg-2.4.9/g10/gpgsql.c:149:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/gpgsql.c:90:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/gpgsql.c:125:10: branch_false: ...to here
gnupg-2.4.9/g10/gpgsql.c:126:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:129:19: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:131:11: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:149:23: throw: if ‘sqlite3_bind_text’ throws an exception...
gnupg-2.4.9/g10/gpgsql.c:149:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  147|                 {
#  148|                   char *text = va_arg (va, char *);
#  149|->                 err = sqlite3_bind_text (stmt, i, text, -1, SQLITE_STATIC);
#  150|                   break;
#  151|                 }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def162]
gnupg-2.4.9/g10/gpgsql.c:156:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g10/gpgsql.c:90:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/gpgsql.c:125:10: branch_false: ...to here
gnupg-2.4.9/g10/gpgsql.c:126:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:127:6: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:129:19: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/gpgsql.c:131:11: branch_true: ...to here
gnupg-2.4.9/g10/gpgsql.c:156:23: throw: if ‘sqlite3_bind_blob’ throws an exception...
gnupg-2.4.9/g10/gpgsql.c:156:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  154|                   char *blob = va_arg (va, void *);
#  155|                   long long length = va_arg (va, long long);
#  156|->                 err = sqlite3_bind_blob (stmt, i, blob, length, SQLITE_STATIC);
#  157|                   break;
#  158|                 }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def163]
gnupg-2.4.9/g10/import.c:2801:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘transferkeylen’
gnupg-2.4.9/g10/import.c:3053:1: enter_function: entry to ‘import_matching_seckeys’
gnupg-2.4.9/g10/import.c:3069:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/g10/import.c:3071:3: branch_false: ...to here
gnupg-2.4.9/g10/import.c:3071:3: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/import.c:3074:43: branch_true: following ‘true’ branch (when ‘node’ is non-NULL)...
gnupg-2.4.9/g10/import.c:3075:9: branch_true: ...to here
gnupg-2.4.9/g10/import.c:3075:8: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/import.c:3077:7: branch_true: ...to here
gnupg-2.4.9/g10/import.c:3078:3: branch_false: following ‘false’ branch (when ‘nfprlist != 0’)...
gnupg-2.4.9/g10/import.c:3079:13: branch_false: ...to here
gnupg-2.4.9/g10/import.c:3080:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/import.c:3085:15: branch_false: ...to here
gnupg-2.4.9/g10/import.c:3093:3: branch_false: following ‘false’ branch (when ‘n == nfprlist’)...
gnupg-2.4.9/g10/import.c:3093:3: branch_false: ...to here
gnupg-2.4.9/g10/import.c:3117:9: call_function: calling ‘do_transfer’ from ‘import_matching_seckeys’
# 2799|   
# 2800|         /* Wrap the key.  */
# 2801|->       wrappedkeylen = transferkeylen + 8;
# 2802|         xfree (wrappedkey);
# 2803|         wrappedkey = xtrymalloc (wrappedkeylen);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def164]
gnupg-2.4.9/g10/keyedit.c:5313:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sub_pk’
gnupg-2.4.9/g10/keyedit.c:5266:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/keyedit.c:5271:11: branch_false: ...to here
gnupg-2.4.9/g10/keyedit.c:5282:25: branch_true: following ‘true’ branch (when ‘node’ is non-NULL)...
gnupg-2.4.9/g10/keyedit.c:5284:11: branch_true: ...to here
gnupg-2.4.9/g10/keyedit.c:5282:25: branch_true: following ‘true’ branch (when ‘node’ is non-NULL)...
gnupg-2.4.9/g10/keyedit.c:5284:11: branch_true: ...to here
gnupg-2.4.9/g10/keyedit.c:5282:25: branch_true: following ‘true’ branch (when ‘node’ is non-NULL)...
gnupg-2.4.9/g10/keyedit.c:5284:11: branch_true: ...to here
gnupg-2.4.9/g10/keyedit.c:5296:15: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/keyedit.c:5298:15: branch_false: ...to here
gnupg-2.4.9/g10/keyedit.c:5298:15: branch_true: following ‘true’ branch (when ‘main_pk’ is non-NULL)...
gnupg-2.4.9/g10/keyedit.c:5298:16: branch_true: ...to here
gnupg-2.4.9/g10/keyedit.c:5302:15: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/keyedit.c:5303:18: branch_false: ...to here
gnupg-2.4.9/g10/keyedit.c:5312:18: branch_false: following ‘false’ branch (when ‘mainkey == 0’)...
gnupg-2.4.9/g10/keyedit.c:5313:35: branch_false: ...to here
gnupg-2.4.9/g10/keyedit.c:5313:35: danger: dereference of NULL ‘sub_pk’
# 5311|   
# 5312|   	      if ((mainkey && main_pk->version < 4)
# 5313|-> 		  || (!mainkey && sub_pk->version < 4))
# 5314|   		{
# 5315|                     /* Note: This won't happen because we don't support

Error: GCC_ANALYZER_WARNING (CWE-476): [#def165]
gnupg-2.4.9/g10/keyid.c:341:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘gcry_mpi_get_opaque(*pk.pkey[i], &nbits)’
gnupg-2.4.9/g10/keyid.c:1048:1: enter_function: entry to ‘v5_fingerprint_from_pk’
gnupg-2.4.9/g10/keyid.c:1053:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/keyid.c:1056:7: branch_false: ...to here
gnupg-2.4.9/g10/keyid.c:1056:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/keyid.c:1058:3: branch_false: ...to here
gnupg-2.4.9/g10/keyid.c:1058:3: call_function: calling ‘do_hash_public_key’ from ‘v5_fingerprint_from_pk’
#  339|                 if (is_sos)
#  340|                   {
#  341|->                   if (*p)
#  342|                       {
#  343|                         nbits = ((nbits + 7) / 8) * 8;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def166]
gnupg-2.4.9/g10/keylist.c:1159:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘buf[0]’
gnupg-2.4.9/g10/keylist.c:1143:15: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/keylist.c:1145:11: branch_true: ...to here
gnupg-2.4.9/g10/keylist.c:1145:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/keylist.c:1151:14: branch_true: ...to here
gnupg-2.4.9/g10/keylist.c:1151:14: branch_false: following ‘false’ branch (when ‘pk’ is non-NULL)...
gnupg-2.4.9/g10/keylist.c:1153:11: branch_false: ...to here
gnupg-2.4.9/g10/keylist.c:1156:23: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/keylist.c:1163:41: branch_false: ...to here
gnupg-2.4.9/g10/keylist.c:1159:26: danger: use of uninitialized value ‘buf[0]’ here
# 1157|   	    sprintf (buf + 2 * j, "%02X", *p);
# 1158|   
# 1159|-> 	  sprintf (buf + strlen (buf), " %lu %u %u %u %lu %lu %u",
# 1160|   		   (ulong) uid->attribs[i].len, uid->attribs[i].type, i + 1,
# 1161|   		   uid->numattribs, (ulong) uid->created,

Error: COMPILER_WARNING (CWE-704): [#def167]
gnupg-2.4.9/g10/keyserver-internal.h:34:24: warning[-Wlto-type-mismatch]: type of ‘parse_keyserver_uri’ does not match original declaration
#   34 | struct keyserver_spec *parse_keyserver_uri (const char *string,
#      |                        ^
gnupg-2.4.9/g10/gpgv.c:644:1: note: type mismatch in parameter 3
#  644 | parse_keyserver_uri (const char *uri, int require_scheme,
#      | ^
gnupg-2.4.9/g10/gpgv.c:644:1: note: ‘parse_keyserver_uri’ was previously declared here
#   32|   void free_keyserver_spec(struct keyserver_spec *keyserver);
#   33|   struct keyserver_spec *keyserver_match(struct keyserver_spec *spec);
#   34|-> struct keyserver_spec *parse_keyserver_uri (const char *string,
#   35|                                               int require_scheme);
#   36|   struct keyserver_spec *parse_preferred_keyserver(PKT_signature *sig);

Error: COMPILER_WARNING (CWE-704): [#def168]
gnupg-2.4.9/g10/keyserver-internal.h:45:5: warning[-Wlto-type-mismatch]: type of ‘keyserver_import_keyid’ does not match original declaration
#   45 | int keyserver_import_keyid (ctrl_t ctrl, u32 *keyid,
#      |     ^
gnupg-2.4.9/g10/gpgv.c:458:1: note: type mismatch in parameter 3
#  458 | keyserver_import_keyid (u32 *keyid, void *dummy, unsigned int flags)
#      | ^
gnupg-2.4.9/g10/gpgv.c:458:1: note: ‘keyserver_import_keyid’ was previously declared here
#   43|   int keyserver_import_fprint_ntds (ctrl_t ctrl,
#   44|                                     const byte *fprint, size_t fprint_len);
#   45|-> int keyserver_import_keyid (ctrl_t ctrl, u32 *keyid,
#   46|                               struct keyserver_spec *keyserver,
#   47|                               unsigned int flags);

Error: COMPILER_WARNING (CWE-704): [#def169]
gnupg-2.4.9/g10/keyserver-internal.h:51:5: warning[-Wlto-type-mismatch]: type of ‘keyserver_import_cert’ does not match original declaration
#   51 | int keyserver_import_cert (ctrl_t ctrl, const char *name, int dane_mode,
#      |     ^
gnupg-2.4.9/g10/gpgv.c:489:1: note: type mismatch in parameter 2
#  489 | keyserver_import_cert (const char *name)
#      | ^
gnupg-2.4.9/g10/gpgv.c:489:1: note: ‘keyserver_import_cert’ was previously declared here
#   49|   gpg_error_t keyserver_search (ctrl_t ctrl, strlist_t tokens);
#   50|   int keyserver_fetch (ctrl_t ctrl, strlist_t urilist, int origin);
#   51|-> int keyserver_import_cert (ctrl_t ctrl, const char *name, int dane_mode,
#   52|                              unsigned char **fpr,size_t *fpr_len);
#   53|   gpg_error_t keyserver_import_wkd (ctrl_t ctrl, const char *name,

Error: COMPILER_WARNING (CWE-704): [#def170]
gnupg-2.4.9/g10/keyserver-internal.h:58:13: warning[-Wlto-type-mismatch]: type of ‘keyserver_import_mbox’ does not match original declaration
#   58 | gpg_error_t keyserver_import_mbox (ctrl_t ctrl, const char *mbox,
#      |             ^
gnupg-2.4.9/g10/gpgv.c:508:1: note: return value type mismatch
#  508 | keyserver_import_mbox (const char *name,struct keyserver_spec *spec)
#      | ^
gnupg-2.4.9/g10/gpgv.c:508:1: note: type ‘int’ should match type ‘gpg_error_t’
gnupg-2.4.9/g10/gpgv.c:508:1: note: ‘keyserver_import_mbox’ was previously declared here
#   56|   int keyserver_import_ntds (ctrl_t ctrl, const char *name,
#   57|                              unsigned char **fpr,size_t *fpr_len);
#   58|-> gpg_error_t keyserver_import_mbox (ctrl_t ctrl, const char *mbox,
#   59|                                      unsigned char **fpr,size_t *fpr_len,
#   60|                                      struct keyserver_spec *keyserver,

Error: COMPILER_WARNING (CWE-704): [#def171]
gnupg-2.4.9/g10/misc.c: scope_hint: In function ‘optlen’
gnupg-2.4.9/g10/misc.c:1547:13: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1547 |   char *end=strpbrk(s," =");
#      |             ^~~~~~~
# 1545|   optlen(const char *s)
# 1546|   {
# 1547|->   char *end=strpbrk(s," =");
# 1548|   
# 1549|     if(end)

Error: COMPILER_WARNING (CWE-704): [#def172]
gnupg-2.4.9/g10/misc.c:1547:13: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1545|   optlen(const char *s)
# 1546|   {
# 1547|->   char *end=strpbrk(s," =");
# 1548|   
# 1549|     if(end)

Error: COMPILER_WARNING (CWE-252): [#def173]
gnupg-2.4.9/g10/photoid.c: scope_hint: In function ‘run_with_pipe’
gnupg-2.4.9/g10/photoid.c:624:7: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  624 |       write (to[1], image, len);
#      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
#  622|     else
#  623|       {
#  624|->       write (to[1], image, len);
#  625|         close (to[1]);
#  626|   

Error: COMPILER_WARNING (CWE-704): [#def174]
gnupg-2.4.9/g10/photoid.h:31:6: warning[-Wlto-type-mismatch]: type of ‘show_photos’ does not match original declaration
#   31 | void show_photos (ctrl_t ctrl, const struct user_attribute *attrs, int count,
#      |      ^
gnupg-2.4.9/g10/gpgv.c:662:1: note: type mismatch in parameter 2
#  662 | show_photos (const struct user_attribute *attrs, int count, PKT_public_key *pk)
#      | ^
gnupg-2.4.9/g10/gpgv.c:662:1: note: ‘show_photos’ was previously declared here
#   29|   int parse_image_header(const struct user_attribute *attr,byte *type,u32 *len);
#   30|   const char *image_type_to_string(byte type,int style);
#   31|-> void show_photos (ctrl_t ctrl, const struct user_attribute *attrs, int count,
#   32|                     PKT_public_key *pk, PKT_user_id *uid);
#   33|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def175]
gnupg-2.4.9/g10/sign.c:784:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sk_rover’
gnupg-2.4.9/g10/sign.c:773:10: branch_true: following ‘true’ branch (when ‘skcount != 0’)...
gnupg-2.4.9/g10/sign.c:773:10: branch_true: ...to here
gnupg-2.4.9/g10/sign.c:781:12: branch_false: following ‘false’ branch (when ‘skcount != i’)...
gnupg-2.4.9/g10/sign.c:780:47: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:781:12: branch_false: following ‘false’ branch (when ‘skcount != i’)...
gnupg-2.4.9/g10/sign.c:780:47: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:784:7: danger: dereference of NULL ‘sk_rover’
#  782|             break;
#  783|   
#  784|->       pk = sk_rover->pk;
#  785|         ops = xmalloc_clear (sizeof *ops);
#  786|         ops->sig_class = sigclass;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def176]
gnupg-2.4.9/g10/sign.c:859:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pt’
gnupg-2.4.9/g10/sign.c:823:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/sign.c:827:9: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:854:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/sign.c:859:23: branch_true: ...to here
gnupg-2.4.9/g10/sign.c:859:7: danger: dereference of NULL ‘pt’
#  857|   
#  858|         /* Note that PT has been initialized above in no_literal mode.  */
#  859|->       pt->timestamp = make_timestamp ();
#  860|         pt->mode = ptmode;
#  861|         pt->len = filesize;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def177]
gnupg-2.4.9/g10/sign.c:1381:15: warning[-Wanalyzer-null-argument]: use of NULL ‘fname’ where non-null expected
gnupg-2.4.9/g10/sign.c:1061:6: branch_false: following ‘false’ branch (when ‘filenames’ is NULL)...
gnupg-2.4.9/g10/sign.c:1072:7: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1072:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/sign.c:1074:6: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1081:6: branch_false: following ‘false’ branch (when ‘encryptflag != 2’)...
gnupg-2.4.9/g10/sign.c:1085:7: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1092:6: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/g10/sign.c:1095:6: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1095:6: branch_false: following ‘false’ branch (when ‘encryptflag == 0’)...
gnupg-2.4.9/g10/sign.c:1100:6: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1100:6: branch_false: following ‘false’ branch (when ‘multifile == 0’)...
gnupg-2.4.9/g10/sign.c:1100:20: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1100:7: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/sign.c:1122:6: branch_true: ...to here
gnupg-2.4.9/g10/sign.c:1140:11: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/sign.c:1147:7: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1153:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/sign.c:1155:7: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1165:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/g10/sign.c:1252:8: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1252:28: branch_false: following ‘false’ branch (when ‘sk_rover’ is NULL)...
gnupg-2.4.9/g10/sign.c:1255:6: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1255:6: branch_true: following ‘true’ branch (when ‘multifile == 0’)...
gnupg-2.4.9/g10/sign.c:1255:22: branch_true: ...to here
gnupg-2.4.9/g10/sign.c:1258:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/sign.c:1259:5: branch_true: ...to here
gnupg-2.4.9/g10/sign.c:1264:6: branch_false: following ‘false’ branch (when ‘encryptflag == 0’)...
gnupg-2.4.9/g10/sign.c:1271:7: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1311:6: branch_false: following ‘false’ branch (when ‘detached != 0’)...
gnupg-2.4.9/g10/sign.c:1319:3: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1324:6: branch_true: following ‘true’ branch (when ‘detached != 0’)...
gnupg-2.4.9/g10/sign.c:1326:27: branch_true: ...to here
gnupg-2.4.9/g10/sign.c:1328:10: branch_false: following ‘false’ branch (when ‘multifile == 0’)...
gnupg-2.4.9/g10/sign.c:1370:16: branch_false: ...to here
gnupg-2.4.9/g10/sign.c:1370:15: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/sign.c:1372:22: branch_true: ...to here
gnupg-2.4.9/g10/sign.c:1381:15: danger: argument 1 (‘fname’) NULL where non-null expected
# 1379|             mdb = gcry_md_read(mfx.md, opt.def_digest_algo);
# 1380|             mdlen = gcry_md_get_algo_dlen(opt.def_digest_algo);
# 1381|->           if (strlen(fname) != mdlen * 2 + 11)
# 1382|               log_bug("digests must be %zu + '@' + 5 bytes\n", mdlen);
# 1383|             d = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
gnupg-2.4.9/g10/test.c:159:7: warning[-Wanalyzer-malloc-leak]: leak of ‘prepend_srcdir("t-keydb-get-keyblock.gpg")’
gnupg-2.4.9/g10/t-keydb-get-keyblock.c:26:1: enter_function: entry to ‘do_test’
gnupg-2.4.9/g10/t-keydb-get-keyblock.c:44:11: call_function: calling ‘prepend_srcdir’ from ‘do_test’
gnupg-2.4.9/g10/t-keydb-get-keyblock.c:44:11: return_function: returning to ‘do_test’ from ‘prepend_srcdir’
gnupg-2.4.9/g10/t-keydb-get-keyblock.c:45:8: throw: if ‘keydb_add_resource’ throws an exception...
gnupg-2.4.9/g10/test.c:159:7: danger: ‘prepend_srcdir("t-keydb-get-keyblock.gpg")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  157|     char *result;
#  158|   
#  159|->   if (!srcdir && !(srcdir = getenv ("abs_top_srcdir")))
#  160|       srcdir = ".";
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
gnupg-2.4.9/g10/test.c:159:7: warning[-Wanalyzer-malloc-leak]: leak of ‘prepend_srcdir("t-keydb-keyring.kbx")’
gnupg-2.4.9/g10/t-keydb.c:25:1: enter_function: entry to ‘do_test’
gnupg-2.4.9/g10/t-keydb.c:40:11: call_function: calling ‘prepend_srcdir’ from ‘do_test’
gnupg-2.4.9/g10/t-keydb.c:40:11: return_function: returning to ‘do_test’ from ‘prepend_srcdir’
gnupg-2.4.9/g10/t-keydb.c:41:8: throw: if ‘keydb_add_resource’ throws an exception...
gnupg-2.4.9/g10/test.c:159:7: danger: ‘prepend_srcdir("t-keydb-keyring.kbx")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  157|     char *result;
#  158|   
#  159|->   if (!srcdir && !(srcdir = getenv ("abs_top_srcdir")))
#  160|       srcdir = ".";
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
gnupg-2.4.9/g10/test.c:159:7: warning[-Wanalyzer-malloc-leak]: leak of ‘prepend_srcdir("t-stutter-data.asc")’
gnupg-2.4.9/g10/t-stutter.c:374:1: enter_function: entry to ‘do_test’
gnupg-2.4.9/g10/t-stutter.c:400:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/t-stutter.c:400:48: call_function: calling ‘prepend_srcdir’ from ‘do_test’
gnupg-2.4.9/g10/t-stutter.c:400:48: return_function: returning to ‘do_test’ from ‘prepend_srcdir’
gnupg-2.4.9/g10/t-stutter.c:403:7: call_function: calling ‘parse_session_key’ from ‘do_test’
#  157|     char *result;
#  158|   
#  159|->   if (!srcdir && !(srcdir = getenv ("abs_top_srcdir")))
#  160|       srcdir = ".";
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def181]
gnupg-2.4.9/g10/test.c:163:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected
gnupg-2.4.9/g10/test.c:162:12: acquire_memory: this call could return NULL
gnupg-2.4.9/g10/test.c:163:3: danger: argument 1 (‘result’) from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#  161|   
#  162|     result = malloc (strlen (srcdir) + strlen ("/g10/") + strlen (fname) + 1);
#  163|->   strcpy (result, srcdir);
#  164|     strcat (result, "/g10/");
#  165|     strcat (result, fname);

Error: COMPILER_WARNING (CWE-704): [#def182]
gnupg-2.4.9/g10/tofu.c: scope_hint: In function ‘ask_about_binding’
gnupg-2.4.9/g10/tofu.c:1986:26: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1986 |           char *choice = strchr (choices, *response);
#      |                          ^~~~~~
# 1984|         else if (!response[1])
# 1985|           {
# 1986|->           char *choice = strchr (choices, *response);
# 1987|   
# 1988|             if (choice)

Error: COMPILER_WARNING (CWE-704): [#def183]
gnupg-2.4.9/g10/tofu.c:1986:26: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1984|         else if (!response[1])
# 1985|           {
# 1986|->           char *choice = strchr (choices, *response);
# 1987|   
# 1988|             if (choice)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def184]
gnupg-2.4.9/g10/trust.c:71:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
gnupg-2.4.9/g10/trust.c:64:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/trust.c:68:13: branch_true: ...to here
gnupg-2.4.9/g10/trust.c:69:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/g10/trust.c:71:12: branch_true: ...to here
gnupg-2.4.9/g10/trust.c:71:11: danger: dereference of NULL ‘strchr(gcry_strdup(string), 35)’
#   69|         if (buf)
#   70|           {
#   71|->           *strchr (buf, '#') = 0;
#   72|             tdb_register_trusted_key (buf);
#   73|             xfree (buf);

Error: GCC_ANALYZER_WARNING (CWE-835): [#def185]
gnupg-2.4.9/g10/verify.c:296:13: warning[-Wanalyzer-infinite-loop]: infinite loop
#  294|     if (!string || !*string)
#  295|       return 0;
#  296|->   for (n=0; hexdigitp (string); string++)
#  297|       n++;
#  298|     if (!*string && (n == 40 || n == 64))

Error: GCC_ANALYZER_WARNING (CWE-457): [#def186]
gnupg-2.4.9/g13/g13tuple.c:240:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘n’
#  238|   
#  239|     s = find_tuple (tupledesc, tag, &n);
#  240|->   return convert_uint (s, n, r_value);
#  241|   }
#  242|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def187]
gnupg-2.4.9/g13/server.c:721:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g13/server.c:698:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g13/server.c:700:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/g13/server.c:702:11: branch_false: ...to here
gnupg-2.4.9/g13/server.c:702:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/g13/server.c:704:11: branch_true: ...to here
gnupg-2.4.9/g13/server.c:721:14: throw: if ‘get_status_string’ throws an exception...
gnupg-2.4.9/g13/server.c:721:14: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  719|   
#  720|         fputs ("[GNUPG:] ", statusfp);
#  721|->       fputs (get_status_string (no), statusfp);
#  722|   
#  723|         while ( (text = va_arg (arg_ptr, const char*) ))

Error: GCC_ANALYZER_WARNING (CWE-404): [#def188]
gnupg-2.4.9/g13/server.c:737:7: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g13/server.c:698:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g13/server.c:700:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/g13/server.c:702:11: branch_false: ...to here
gnupg-2.4.9/g13/server.c:702:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/g13/server.c:704:11: branch_true: ...to here
gnupg-2.4.9/g13/server.c:737:7: throw: if ‘fflush’ throws an exception...
gnupg-2.4.9/g13/server.c:737:7: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  735|           }
#  736|         putc ('\n', statusfp);
#  737|->       fflush (statusfp);
#  738|       }
#  739|     else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def189]
gnupg-2.4.9/g13/server.c:741:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g13/server.c:698:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g13/server.c:702:11: branch_false: following ‘false’ branch...
gnupg-2.4.9/g13/server.c:741:13: branch_false: ...to here
gnupg-2.4.9/g13/server.c:741:13: throw: if ‘get_status_string’ throws an exception...
gnupg-2.4.9/g13/server.c:741:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  739|     else
#  740|       {
#  741|->       err = vprint_assuan_status_strings (ctrl->server_local->assuan_ctx,
#  742|                                             get_status_string (no), arg_ptr);
#  743|       }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def190]
gnupg-2.4.9/g13/sh-cmd.c:917:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/g13/sh-cmd.c:915:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/g13/sh-cmd.c:917:9: throw: if ‘get_status_string’ throws an exception...
gnupg-2.4.9/g13/sh-cmd.c:917:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  915|     va_start (arg_ptr, no);
#  916|   
#  917|->   err = vprint_assuan_status_strings (ctrl->server_local->assuan_ctx,
#  918|                                         get_status_string (no), arg_ptr);
#  919|     va_end (arg_ptr);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def191]
gnupg-2.4.9/kbx/kbxserver.c:188:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/kbx/kbxserver.c:178:1: enter_function: entry to ‘kbxd_status_printf’
gnupg-2.4.9/kbx/kbxserver.c:184:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/kbx/kbxserver.c:187:3: branch_false: ...to here
gnupg-2.4.9/kbx/kbxserver.c:187:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/kbx/kbxserver.c:188:9: throw: if ‘vprint_assuan_status’ throws an exception...
gnupg-2.4.9/kbx/kbxserver.c:188:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  186|   
#  187|     va_start (arg_ptr, format);
#  188|->   err = vprint_assuan_status (ctx, keyword, format, arg_ptr);
#  189|     va_end (arg_ptr);
#  190|     return err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
gnupg-2.4.9/kbx/keybox-dump.c:533:12: warning[-Wanalyzer-malloc-leak]: leak of ‘dupitems’
gnupg-2.4.9/kbx/keybox-dump.c:788:1: enter_function: entry to ‘_keybox_dump_find_dups’
gnupg-2.4.9/kbx/keybox-dump.c:803:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:807:14: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:807:14: acquire_memory: allocated here
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: following ‘false’ branch (when ‘dupitems’ is non-NULL)...
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:819:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:823:11: branch_true: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:823:11: call_function: calling ‘hash_blob_rawdata’ from ‘_keybox_dump_find_dups’
#  531|     ulong rawdata_off, rawdata_len;
#  532|   
#  533|->   buffer = _keybox_get_blob_image (blob, &length);
#  534|   
#  535|     if (length < 32)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
gnupg-2.4.9/kbx/keybox-dump.c:565:3: warning[-Wanalyzer-malloc-leak]: leak of ‘dupitems’
gnupg-2.4.9/kbx/keybox-dump.c:788:1: enter_function: entry to ‘_keybox_dump_find_dups’
gnupg-2.4.9/kbx/keybox-dump.c:803:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:807:14: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:807:14: acquire_memory: allocated here
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: following ‘false’ branch (when ‘dupitems’ is non-NULL)...
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:819:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:823:11: branch_true: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:823:11: call_function: calling ‘hash_blob_rawdata’ from ‘_keybox_dump_find_dups’
#  563|       return -1; /* Out of bounds.  */
#  564|   
#  565|->   gcry_md_hash_buffer (GCRY_MD_SHA1, digest, buffer+rawdata_off, rawdata_len);
#  566|     return 0;
#  567|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
gnupg-2.4.9/kbx/keybox-dump.c:819:18: warning[-Wanalyzer-malloc-leak]: leak of ‘dupitems’
gnupg-2.4.9/kbx/keybox-dump.c:803:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:807:14: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:807:14: acquire_memory: allocated here
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: following ‘false’ branch (when ‘dupitems’ is non-NULL)...
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:819:18: throw: if ‘_keybox_read_blob’ throws an exception...
gnupg-2.4.9/kbx/keybox-dump.c:819:18: danger: ‘dupitems’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  817|     dupitems_count = 0;
#  818|   
#  819|->   while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) )
#  820|       {
#  821|         unsigned char digest[20];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
gnupg-2.4.9/kbx/keybox-dump.c:849:7: warning[-Wanalyzer-malloc-leak]: leak of ‘dupitems’
gnupg-2.4.9/kbx/keybox-dump.c:803:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:807:14: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:807:14: acquire_memory: allocated here
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: following ‘false’ branch (when ‘dupitems’ is non-NULL)...
gnupg-2.4.9/kbx/keybox-dump.c:808:6: branch_false: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:819:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:823:11: branch_true: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:823:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/kbx/keybox-dump.c:824:9: branch_true: ...to here
gnupg-2.4.9/kbx/keybox-dump.c:849:7: throw: if ‘_keybox_release_blob’ throws an exception...
gnupg-2.4.9/kbx/keybox-dump.c:849:7: danger: ‘dupitems’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  847|             dupitems_count++;
#  848|           }
#  849|->       _keybox_release_blob (blob);
#  850|         recno++;
#  851|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def196]
gnupg-2.4.9/scd/app-piv.c:2946:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ecc_d_len’
gnupg-2.4.9/scd/app-piv.c:2854:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/scd/app-piv.c:2857:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/app-piv.c:2862:18: branch_false: ...to here
gnupg-2.4.9/scd/app-piv.c:2862:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/app-piv.c:2865:11: branch_false: ...to here
gnupg-2.4.9/scd/app-piv.c:2870:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/app-piv.c:2873:18: branch_false: ...to here
gnupg-2.4.9/scd/app-piv.c:2874:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/app-piv.c:2879:11: branch_false: ...to here
gnupg-2.4.9/scd/app-piv.c:2889:14: branch_true: following ‘true’ branch...
gnupg-2.4.9/scd/app-piv.c:2889:25: branch_true: ...to here
gnupg-2.4.9/scd/app-piv.c:2932:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/app-piv.c:2932:10: branch_false: ...to here
gnupg-2.4.9/scd/app-piv.c:2937:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/app-piv.c:2946:9: danger: use of uninitialized value ‘ecc_d_len’ here
# 2944|       log_info ("ECC private key size is %u bytes\n", (unsigned int)ecc_d_len);
# 2945|   
# 2946|->   err = concat_tlv_list (1, &apdudata, &apdudatalen,
# 2947|                            (int)0x06, (size_t)ecc_d_len, ecc_d,
# 2948|                            (int)0, (size_t)0, NULL);

Error: COMPILER_WARNING (CWE-252): [#def197]
gnupg-2.4.9/scd/app.c: scope_hint: In function ‘card_list_signal’
gnupg-2.4.9/scd/app.c:389:5: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  389 |     write (card_list_lock.notify_pipe[1], "", 1);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  387|     npth_mutex_lock (&card_list_lock.lock);
#  388|     if (card_list_lock.notify_watchers)
#  389|->     write (card_list_lock.notify_pipe[1], "", 1);
#  390|     npth_mutex_unlock (&card_list_lock.lock);
#  391|   #endif

Error: COMPILER_WARNING (CWE-252): [#def198]
gnupg-2.4.9/scd/app.c: scope_hint: In function ‘card_list_wait’
gnupg-2.4.9/scd/app.c:450:11: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
#  450 |           read (card_list_lock.notify_pipe[0], buf, sizeof buf);
#      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  448|             char buf[256];
#  449|   
#  450|->           read (card_list_lock.notify_pipe[0], buf, sizeof buf);
#  451|             ret = 0;
#  452|             break;

Error: COMPILER_WARNING: [#def199]
gnupg-2.4.9/scd/command.c: scope_hint: In function ‘cmd_setattr’
gnupg-2.4.9/scd/command.c:1290:7: warning[-Wunused-but-set-variable=]: variable ‘keywordlen’ set but not used
# 1290 |   int keywordlen;
#      |       ^~~~~~~~~~
# 1288|     gpg_error_t err;
# 1289|     char *keyword;
# 1290|->   int keywordlen;
# 1291|     size_t nbytes;
# 1292|     char *line, *linebuf;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def200]
gnupg-2.4.9/scd/command.c:2634:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/scd/command.c:2603:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/scd/command.c:2634:3: throw: if ‘assuan_write_status’ throws an exception...
gnupg-2.4.9/scd/command.c:2634:3: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2632|       }
# 2633|     *p = 0;
# 2634|->   assuan_write_status (ctx, keyword, buf);
# 2635|   
# 2636|     va_end (arg_ptr);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def201]
gnupg-2.4.9/scd/command.c:2669:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/scd/command.c:2665:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/command.c:2668:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/scd/command.c:2669:9: throw: if ‘vprint_assuan_status’ throws an exception...
gnupg-2.4.9/scd/command.c:2669:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 2667|   
# 2668|     va_start (arg_ptr, format);
# 2669|->   err = vprint_assuan_status (ctx, keyword, format, arg_ptr);
# 2670|     va_end (arg_ptr);
# 2671|     return err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def202]
gnupg-2.4.9/scd/scdaemon.c:1188:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘assuan_sock_new(1, 1, 0)’
gnupg-2.4.9/scd/scdaemon.c:1167:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/scdaemon.c:1173:12: branch_false: ...to here
gnupg-2.4.9/scd/scdaemon.c:1179:8: branch_false: following ‘false’ branch...
gnupg-2.4.9/scd/scdaemon.c:1188:9: branch_false: ...to here
gnupg-2.4.9/scd/scdaemon.c:1220:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/scd/scdaemon.c:1222:7: branch_true: ...to here
gnupg-2.4.9/scd/scdaemon.c:1188:9: danger: ‘assuan_sock_new(1, 1, 0)’ leaks here
# 1186|           scd_exit (2);
# 1187|         }
# 1188|->     if (redirected)
# 1189|         {
# 1190|           *r_redir_name = xstrdup (unaddr->sun_path);

Error: COMPILER_WARNING (CWE-252): [#def203]
gnupg-2.4.9/scd/scdaemon.c: scope_hint: In function ‘scd_kick_the_loop’
gnupg-2.4.9/scd/scdaemon.c:1292:3: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
# 1292 |   write (notify_fd, "", 1);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~
# 1290|                  w32_strerror (-1));
# 1291|   #elif defined(HAVE_PSELECT_NO_EINTR)
# 1292|->   write (notify_fd, "", 1);
# 1293|   #else
# 1294|     int ret = kill (main_thread_pid, SIGCONT);

Error: COMPILER_WARNING (CWE-252): [#def204]
gnupg-2.4.9/scd/scdaemon.c: scope_hint: In function ‘handle_connections’
gnupg-2.4.9/scd/scdaemon.c:1431:11: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
# 1431 |           read (pipe_fd[0], buf, sizeof buf);
#      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1429|             char buf[256];
# 1430|   
# 1431|->           read (pipe_fd[0], buf, sizeof buf);
# 1432|           }
# 1433|   #endif

Error: GCC_ANALYZER_WARNING (CWE-457): [#def205]
gnupg-2.4.9/sm/certreqgen.c:1529:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘siglen’
gnupg-2.4.9/sm/certreqgen.c:817:1: enter_function: entry to ‘create_request’
gnupg-2.4.9/sm/certreqgen.c:846:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:849:15: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:855:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/certreqgen.c:858:7: branch_true: ...to here
gnupg-2.4.9/sm/certreqgen.c:883:9: call_function: calling ‘get_parameter_value’ from ‘create_request’
gnupg-2.4.9/sm/certreqgen.c:883:9: return_function: returning to ‘create_request’ from ‘get_parameter_value’
gnupg-2.4.9/sm/certreqgen.c:884:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:884:6: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:892:20: call_function: calling ‘get_parameter_value’ from ‘create_request’
gnupg-2.4.9/sm/certreqgen.c:892:20: return_function: returning to ‘create_request’ from ‘get_parameter_value’
gnupg-2.4.9/sm/certreqgen.c:892:15: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:892:15: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:914:20: call_function: calling ‘get_parameter_value’ from ‘create_request’
gnupg-2.4.9/sm/certreqgen.c:914:20: return_function: returning to ‘create_request’ from ‘get_parameter_value’
gnupg-2.4.9/sm/certreqgen.c:914:15: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:914:15: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:941:20: call_function: calling ‘get_parameter_value’ from ‘create_request’
gnupg-2.4.9/sm/certreqgen.c:941:20: return_function: returning to ‘create_request’ from ‘get_parameter_value’
gnupg-2.4.9/sm/certreqgen.c:941:15: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:968:9: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:969:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:977:9: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:977:9: call_function: calling ‘get_parameter_uint’ from ‘create_request’
gnupg-2.4.9/sm/certreqgen.c:977:9: return_function: returning to ‘create_request’ from ‘get_parameter_uint’
gnupg-2.4.9/sm/certreqgen.c:1029:12: call_function: calling ‘get_parameter_value’ from ‘create_request’
gnupg-2.4.9/sm/certreqgen.c:1029:12: return_function: returning to ‘create_request’ from ‘get_parameter_value’
gnupg-2.4.9/sm/certreqgen.c:1030:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:1030:6: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:1434:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:1440:11: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:1451:14: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/certreqgen.c:1456:17: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:1456:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/certreqgen.c:1463:11: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:1470:14: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/certreqgen.c:1472:18: branch_true: ...to here
gnupg-2.4.9/sm/certreqgen.c:1472:18: branch_true: following ‘true’ branch (when ‘tbsmb’ is non-NULL)...
gnupg-2.4.9/sm/certreqgen.c:1474:29: branch_true: ...to here
gnupg-2.4.9/sm/certreqgen.c:1476:22: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/certreqgen.c:1477:26: branch_true: ...to here
gnupg-2.4.9/sm/certreqgen.c:1523:14: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/certreqgen.c:1529:17: branch_false: ...to here
gnupg-2.4.9/sm/certreqgen.c:1529:17: danger: use of uninitialized value ‘siglen’ here
# 1527|               }
# 1528|   
# 1529|->           err = transform_sigval (sigval, siglen, mdalgo, &newsigval, NULL);
# 1530|             xfree (sigval);
# 1531|             if (!err)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def206]
gnupg-2.4.9/sm/decrypt.c:1368:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbits’
gnupg-2.4.9/sm/decrypt.c:1075:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/decrypt.c:1082:11: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1083:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/decrypt.c:1091:20: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1095:6: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/decrypt.c:1101:8: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1105:6: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/decrypt.c:1111:3: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1116:6: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/decrypt.c:1119:8: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1120:6: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/decrypt.c:1127:3: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1133:10: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/decrypt.c:1139:11: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1151:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/decrypt.c:1177:17: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1177:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/decrypt.c:1188:29: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1194:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/decrypt.c:1200:16: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1204:14: branch_false: following ‘false’ branch (when ‘rc == 0’)...
gnupg-2.4.9/sm/decrypt.c:1204:14: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1210:24: branch_true: following ‘true’ branch (when ‘any_key == 0’)...
gnupg-2.4.9/sm/decrypt.c:1221:27: branch_true: ...to here
gnupg-2.4.9/sm/decrypt.c:1229:18: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/decrypt.c:1231:15: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1354:18: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/decrypt.c:1354:19: branch_true: ...to here
gnupg-2.4.9/sm/decrypt.c:1354:19: branch_false: following ‘false’ branch (when ‘maybe_pwri != 0’)...
gnupg-2.4.9/sm/decrypt.c:1356:36: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1356:23: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/decrypt.c:1365:22: branch_false: ...to here
gnupg-2.4.9/sm/decrypt.c:1365:22: branch_true: following ‘true’ branch (when ‘maybe_pwri != 0’)...
gnupg-2.4.9/sm/decrypt.c:1365:37: branch_true: ...to here
gnupg-2.4.9/sm/decrypt.c:1368:24: danger: use of uninitialized value ‘nbits’ here
# 1366|                       log_info ("recp %d - KEKRI or PWRI\n", recp);
# 1367|   
# 1368|->                   rc = prepare_decryption (ctrl, hexkeygrip, pk_algo, nbits,
# 1369|                                              desc, enc_val, &dfparm);
# 1370|                     xfree (enc_val);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def207]
gnupg-2.4.9/sm/encrypt.c:157:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dek’
gnupg-2.4.9/sm/encrypt.c:577:1: enter_function: entry to ‘gpgsm_encrypt’
gnupg-2.4.9/sm/encrypt.c:601:23: branch_true: following ‘true’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:602:10: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:604:6: branch_false: following ‘false’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:604:6: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:618:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:626:13: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:627:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:634:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:635:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:636:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:637:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:640:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:647:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:653:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:658:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:661:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:662:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:669:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:674:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:675:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:676:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:686:8: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:684:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:695:8: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:695:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:707:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:708:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:709:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:715:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/sm/encrypt.c:722:67: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:723:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:730:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:734:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:740:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:747:35: branch_true: following ‘true’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:752:13: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:752:13: release_memory: ‘gcry_calloc_secure(1, 96)’ is NULL
gnupg-2.4.9/sm/encrypt.c:778:13: call_function: calling ‘encrypt_dek’ from ‘gpgsm_encrypt’
#  155|     int rc;
#  156|   
#  157|->   p = xtrymalloc (64 + 2 * dek->keylen);
#  158|     if (!p)
#  159|       return gpg_error_from_syserror ();

Error: GCC_ANALYZER_WARNING (CWE-476): [#def208]
gnupg-2.4.9/sm/encrypt.c:355:8: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dek’
gnupg-2.4.9/sm/encrypt.c:577:1: enter_function: entry to ‘gpgsm_encrypt’
gnupg-2.4.9/sm/encrypt.c:601:23: branch_true: following ‘true’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:602:10: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:604:6: branch_false: following ‘false’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:604:6: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:618:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:626:13: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:627:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:634:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:635:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:636:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:637:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:640:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:647:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:653:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:658:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:661:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:662:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:669:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:674:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:675:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:676:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:686:8: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:684:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:695:8: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:695:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:707:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:708:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:709:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:715:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/sm/encrypt.c:722:67: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:723:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:730:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:734:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:740:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:747:35: branch_true: following ‘true’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:752:13: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:752:13: release_memory: ‘gcry_calloc_secure(1, 96)’ is NULL
gnupg-2.4.9/sm/encrypt.c:778:13: call_function: calling ‘encrypt_dek’ from ‘gpgsm_encrypt’
#  353|   
#  354|     /* Wrap the key.  */
#  355|->   if ((dek->keylen % 8) || dek->keylen < 16)
#  356|       {
#  357|         log_error ("%s: can't use a session key of %u bytes\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def209]
gnupg-2.4.9/sm/encrypt.c:462:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dek’
gnupg-2.4.9/sm/encrypt.c:577:1: enter_function: entry to ‘gpgsm_encrypt’
gnupg-2.4.9/sm/encrypt.c:601:23: branch_true: following ‘true’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:602:10: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:604:6: branch_false: following ‘false’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:604:6: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:618:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:626:13: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:627:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:634:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:635:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:636:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:637:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:640:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:647:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:653:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:658:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:661:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:662:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:669:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:674:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:675:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:676:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:686:8: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:684:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:695:8: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:695:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:707:9: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:708:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/encrypt.c:709:11: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:715:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/sm/encrypt.c:722:67: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:723:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:730:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:734:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/encrypt.c:740:3: branch_false: ...to here
gnupg-2.4.9/sm/encrypt.c:747:35: branch_true: following ‘true’ branch (when ‘cl’ is non-NULL)...
gnupg-2.4.9/sm/encrypt.c:752:13: branch_true: ...to here
gnupg-2.4.9/sm/encrypt.c:752:13: release_memory: ‘gcry_calloc_secure(1, 96)’ is NULL
gnupg-2.4.9/sm/encrypt.c:778:13: call_function: calling ‘encrypt_dek’ from ‘gpgsm_encrypt’
#  460|       {
#  461|         log_printsexp (" pubkey:", s_pkey);
#  462|->       log_printhex (dek->key, dek->keylen, "CEK .....:");
#  463|       }
#  464|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def210]
gnupg-2.4.9/sm/export.c:770:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘resultlen’
gnupg-2.4.9/sm/export.c:654:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/export.c:661:9: branch_false: ...to here
gnupg-2.4.9/sm/export.c:663:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/export.c:668:9: branch_false: ...to here
gnupg-2.4.9/sm/export.c:685:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/export.c:687:13: branch_true: ...to here
gnupg-2.4.9/sm/export.c:744:6: branch_false: following ‘false’ branch (when ‘kparms’ is NULL)...
gnupg-2.4.9/sm/export.c:750:3: branch_false: ...to here
gnupg-2.4.9/sm/export.c:763:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
gnupg-2.4.9/sm/export.c:769:7: branch_false: ...to here
gnupg-2.4.9/sm/export.c:770:7: danger: use of uninitialized value ‘resultlen’ here
#  768|       {
#  769|         *r_result = result;
#  770|->       *r_resultlen = resultlen;
#  771|       }
#  772|     return err;

Error: COMPILER_WARNING (CWE-704): [#def211]
gnupg-2.4.9/sm/gpgsm.c: scope_hint: In function ‘run_protect_tool’
gnupg-2.4.9/sm/gpgsm.c:2452:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2452 |   av[0] = strrchr (pgm, '/');
#      |         ^
# 2450|   
# 2451|     av = xcalloc (argc+2, sizeof *av);
# 2452|->   av[0] = strrchr (pgm, '/');
# 2453|     if (!av[0])
# 2454|       av[0] = xstrdup (pgm);

Error: COMPILER_WARNING (CWE-704): [#def212]
gnupg-2.4.9/sm/gpgsm.c:2452:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2450|   
# 2451|     av = xcalloc (argc+2, sizeof *av);
# 2452|->   av[0] = strrchr (pgm, '/');
# 2453|     if (!av[0])
# 2454|       av[0] = xstrdup (pgm);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def213]
gnupg-2.4.9/sm/minip12.c:201:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&fname, "wb")’
gnupg-2.4.9/sm/minip12.c:200:12: acquire_resource: opened here
gnupg-2.4.9/sm/minip12.c:201:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/minip12.c:201:18: branch_false: ...to here
gnupg-2.4.9/sm/minip12.c:201:11: danger: ‘fopen(&fname, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  199|         log_debug ("dumping %zu bytes to '%s'\n", n, fname);
#  200|         fp = fopen (fname, "wb");
#  201|->       if (!fp || fwrite (s, n, 1, fp) != 1)
#  202|           log_assert (!"fopen or fwrite failed");
#  203|         fclose (fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
gnupg-2.4.9/sm/minip12.c:201:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&fname, "wb")’
gnupg-2.4.9/sm/minip12.c:200:12: acquire_memory: allocated here
gnupg-2.4.9/sm/minip12.c:201:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/minip12.c:201:18: branch_false: ...to here
gnupg-2.4.9/sm/minip12.c:201:11: danger: ‘fopen(&fname, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  199|         log_debug ("dumping %zu bytes to '%s'\n", n, fname);
#  200|         fp = fopen (fname, "wb");
#  201|->       if (!fp || fwrite (s, n, 1, fp) != 1)
#  202|           log_assert (!"fopen or fwrite failed");
#  203|         fclose (fp);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def215]
gnupg-2.4.9/sm/server.c:1516:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/sm/server.c:1493:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/sm/server.c:1495:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/server.c:1497:11: branch_false: ...to here
gnupg-2.4.9/sm/server.c:1497:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/server.c:1499:11: branch_true: ...to here
gnupg-2.4.9/sm/server.c:1516:14: throw: if ‘get_status_string’ throws an exception...
gnupg-2.4.9/sm/server.c:1516:14: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1514|   
# 1515|         fputs ("[GNUPG:] ", statusfp);
# 1516|->       fputs (get_status_string (no), statusfp);
# 1517|   
# 1518|         while ( (text = va_arg (arg_ptr, const char*) ))

Error: GCC_ANALYZER_WARNING (CWE-404): [#def216]
gnupg-2.4.9/sm/server.c:1536:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/sm/server.c:1493:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/sm/server.c:1495:7: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/server.c:1497:11: branch_false: ...to here
gnupg-2.4.9/sm/server.c:1497:11: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/server.c:1499:11: branch_true: ...to here
gnupg-2.4.9/sm/server.c:1532:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/server.c:1536:11: branch_false: ...to here
gnupg-2.4.9/sm/server.c:1536:11: throw: if ‘fflush’ throws an exception...
gnupg-2.4.9/sm/server.c:1536:11: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1534|         else
# 1535|           {
# 1536|->           fflush (statusfp);
# 1537|             if (ferror (statusfp))
# 1538|               err = gpg_error_from_syserror ();

Error: GCC_ANALYZER_WARNING (CWE-404): [#def217]
gnupg-2.4.9/sm/server.c:1543:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/sm/server.c:1493:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/sm/server.c:1497:11: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/server.c:1543:13: branch_false: ...to here
gnupg-2.4.9/sm/server.c:1543:13: throw: if ‘get_status_string’ throws an exception...
gnupg-2.4.9/sm/server.c:1543:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1541|     else
# 1542|       {
# 1543|->       err = vprint_assuan_status_strings (ctrl->server_local->assuan_ctx,
# 1544|                                             get_status_string (no), arg_ptr);
# 1545|       }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def218]
gnupg-2.4.9/sm/t-minip12.c:172:19: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/sm/t-minip12.c:687:1: enter_function: entry to ‘main’
gnupg-2.4.9/sm/t-minip12.c:764:6: branch_false: following ‘false’ branch (when ‘name’ is NULL)...
gnupg-2.4.9/sm/t-minip12.c:773:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:775:19: call_function: calling ‘prepend_srcdir’ from ‘main’
#  170|       }
#  171|     needed++;
#  172|->   buffer = xmode? xmalloc (needed) : malloc (needed);
#  173|     for (p = buffer, argc=0; argv[argc]; argc++)
#  174|       p = stpcpy (p, argv[argc]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def219]
gnupg-2.4.9/sm/t-minip12.c:267:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(descfname, "r")’
gnupg-2.4.9/sm/t-minip12.c:594:1: enter_function: entry to ‘run_tests_from_file’
gnupg-2.4.9/sm/t-minip12.c:611:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:615:7: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:619:8: acquire_resource: opened here
gnupg-2.4.9/sm/t-minip12.c:620:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:623:3: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:624:18: call_function: calling ‘read_textline’ from ‘run_tests_from_file’
#  265|             if (feof (fp))
#  266|               return NULL;
#  267|->           die ("error reading input line: %s\n", strerror (errno));
#  268|           }
#  269|         ++*lineno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def220]
gnupg-2.4.9/sm/t-minip12.c:267:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(descfname, "r")’
gnupg-2.4.9/sm/t-minip12.c:594:1: enter_function: entry to ‘run_tests_from_file’
gnupg-2.4.9/sm/t-minip12.c:611:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:615:7: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:619:8: acquire_memory: allocated here
gnupg-2.4.9/sm/t-minip12.c:620:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:623:3: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:624:18: call_function: calling ‘read_textline’ from ‘run_tests_from_file’
#  265|             if (feof (fp))
#  266|               return NULL;
#  267|->           die ("error reading input line: %s\n", strerror (errno));
#  268|           }
#  269|         ++*lineno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def221]
gnupg-2.4.9/sm/t-minip12.c:269:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(descfname, "r")’
gnupg-2.4.9/sm/t-minip12.c:594:1: enter_function: entry to ‘run_tests_from_file’
gnupg-2.4.9/sm/t-minip12.c:611:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:615:7: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:619:8: acquire_resource: opened here
gnupg-2.4.9/sm/t-minip12.c:620:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:623:3: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:624:18: call_function: calling ‘read_textline’ from ‘run_tests_from_file’
gnupg-2.4.9/sm/t-minip12.c:624:18: return_function: returning to ‘run_tests_from_file’ from ‘read_textline’
gnupg-2.4.9/sm/t-minip12.c:624:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/t-minip12.c:626:12: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:626:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/t-minip12.c:628:15: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:628:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:630:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:630:11: throw: if ‘gcry_free’ throws an exception...
gnupg-2.4.9/sm/t-minip12.c:269:9: danger: ‘fopen(descfname, "r")’ leaks here; was opened at [(4)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/3)
#  267|             die ("error reading input line: %s\n", strerror (errno));
#  268|           }
#  269|->       ++*lineno;
#  270|         p = strchr (line, '\n');
#  271|         if (!p)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
gnupg-2.4.9/sm/t-minip12.c:269:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(descfname, "r")’
gnupg-2.4.9/sm/t-minip12.c:594:1: enter_function: entry to ‘run_tests_from_file’
gnupg-2.4.9/sm/t-minip12.c:611:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:615:7: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:619:8: acquire_memory: allocated here
gnupg-2.4.9/sm/t-minip12.c:620:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:623:3: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:624:18: call_function: calling ‘read_textline’ from ‘run_tests_from_file’
gnupg-2.4.9/sm/t-minip12.c:624:18: return_function: returning to ‘run_tests_from_file’ from ‘read_textline’
gnupg-2.4.9/sm/t-minip12.c:624:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/t-minip12.c:626:12: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:626:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/sm/t-minip12.c:628:15: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:628:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/sm/t-minip12.c:630:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:630:11: throw: if ‘gcry_free’ throws an exception...
gnupg-2.4.9/sm/t-minip12.c:269:9: danger: ‘fopen(descfname, "r")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/3)
#  267|             die ("error reading input line: %s\n", strerror (errno));
#  268|           }
#  269|->       ++*lineno;
#  270|         p = strchr (line, '\n');
#  271|         if (!p)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def223]
gnupg-2.4.9/sm/t-minip12.c:399:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "rb")’
gnupg-2.4.9/sm/t-minip12.c:687:1: enter_function: entry to ‘main’
gnupg-2.4.9/sm/t-minip12.c:740:6: branch_false: following ‘false’ branch (when ‘argc != 0’)...
gnupg-2.4.9/sm/t-minip12.c:745:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:764:6: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
gnupg-2.4.9/sm/t-minip12.c:766:7: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:767:13: call_function: calling ‘one_file’ from ‘main’
#  397|       }
#  398|   
#  399|->   if (fstat (fileno(fp), &st))
#  400|       {
#  401|         fprintf (stderr, PGM": can't stat '%s': %s\n", name, strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
gnupg-2.4.9/sm/t-minip12.c:399:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "rb")’
gnupg-2.4.9/sm/t-minip12.c:687:1: enter_function: entry to ‘main’
gnupg-2.4.9/sm/t-minip12.c:740:6: branch_false: following ‘false’ branch (when ‘argc != 0’)...
gnupg-2.4.9/sm/t-minip12.c:745:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:764:6: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
gnupg-2.4.9/sm/t-minip12.c:766:7: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:767:13: call_function: calling ‘one_file’ from ‘main’
#  397|       }
#  398|   
#  399|->   if (fstat (fileno(fp), &st))
#  400|       {
#  401|         fprintf (stderr, PGM": can't stat '%s': %s\n", name, strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def225]
gnupg-2.4.9/sm/t-minip12.c:405:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "rb")’
gnupg-2.4.9/sm/t-minip12.c:687:1: enter_function: entry to ‘main’
gnupg-2.4.9/sm/t-minip12.c:740:6: branch_false: following ‘false’ branch (when ‘argc != 0’)...
gnupg-2.4.9/sm/t-minip12.c:745:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:764:6: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
gnupg-2.4.9/sm/t-minip12.c:766:7: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:767:13: call_function: calling ‘one_file’ from ‘main’
#  403|       }
#  404|   
#  405|->   buflen = st.st_size;
#  406|     buf = xmalloc (buflen+1);
#  407|     if (fread (buf, buflen, 1, fp) != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
gnupg-2.4.9/sm/t-minip12.c:405:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "rb")’
gnupg-2.4.9/sm/t-minip12.c:687:1: enter_function: entry to ‘main’
gnupg-2.4.9/sm/t-minip12.c:740:6: branch_false: following ‘false’ branch (when ‘argc != 0’)...
gnupg-2.4.9/sm/t-minip12.c:745:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:764:6: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
gnupg-2.4.9/sm/t-minip12.c:766:7: branch_true: ...to here
gnupg-2.4.9/sm/t-minip12.c:767:13: call_function: calling ‘one_file’ from ‘main’
#  403|       }
#  404|   
#  405|->   buflen = st.st_size;
#  406|     buf = xmalloc (buflen+1);
#  407|     if (fread (buf, buflen, 1, fp) != 1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def227]
gnupg-2.4.9/sm/t-minip12.c:671:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(descfname, "r")’
gnupg-2.4.9/sm/t-minip12.c:687:1: enter_function: entry to ‘main’
gnupg-2.4.9/sm/t-minip12.c:764:6: branch_false: following ‘false’ branch (when ‘name’ is NULL)...
gnupg-2.4.9/sm/t-minip12.c:773:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:775:19: call_function: calling ‘prepend_srcdir’ from ‘main’
gnupg-2.4.9/sm/t-minip12.c:775:19: return_function: returning to ‘main’ from ‘prepend_srcdir’
gnupg-2.4.9/sm/t-minip12.c:776:13: call_function: calling ‘run_tests_from_file’ from ‘main’
#  669|         xfree (line);
#  670|       }
#  671|->   if (name)
#  672|       ret |= run_one_test (name, desc, pass, cert, key);
#  673|     xfree (name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
gnupg-2.4.9/sm/t-minip12.c:671:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(descfname, "r")’
gnupg-2.4.9/sm/t-minip12.c:687:1: enter_function: entry to ‘main’
gnupg-2.4.9/sm/t-minip12.c:764:6: branch_false: following ‘false’ branch (when ‘name’ is NULL)...
gnupg-2.4.9/sm/t-minip12.c:773:11: branch_false: ...to here
gnupg-2.4.9/sm/t-minip12.c:775:19: call_function: calling ‘prepend_srcdir’ from ‘main’
gnupg-2.4.9/sm/t-minip12.c:775:19: return_function: returning to ‘main’ from ‘prepend_srcdir’
gnupg-2.4.9/sm/t-minip12.c:776:13: call_function: calling ‘run_tests_from_file’ from ‘main’
#  669|         xfree (line);
#  670|       }
#  671|->   if (name)
#  672|       ret |= run_one_test (name, desc, pass, cert, key);
#  673|     xfree (name);

Error: GCC_ANALYZER_WARNING (CWE-835): [#def229]
gnupg-2.4.9/sm/verify.c:786:13: warning[-Wanalyzer-infinite-loop]: infinite loop
#  784|     if (!string || !*string)
#  785|       return 0;
#  786|->   for (n=0; hexdigitp (string); string++)
#  787|       n++;
#  788|     if (!*string && (n == 40 || n == 64))

Error: COMPILER_WARNING (CWE-252): [#def230]
gnupg-2.4.9/tools/gpg-auth.c: scope_hint: In function ‘getpin’
gnupg-2.4.9/tools/gpg-auth.c:962:3: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#  962 |   fgets (line, ASSUAN_LINELENGTH, stdin);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  960|       }
#  961|   
#  962|->   fgets (line, ASSUAN_LINELENGTH, stdin);
#  963|     if (split_fields (line, fields, DIM (fields)) < DIM (fields))
#  964|       rc = GPG_ERR_PROTOCOL_VIOLATION;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def231]
gnupg-2.4.9/tools/gpg-card.c:561:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tools/gpg-card.c:2467:1: enter_function: entry to ‘cmd_forcesig’
gnupg-2.4.9/tools/gpg-card.c:2473:12: call_function: calling ‘print_help’ from ‘cmd_forcesig’
#  559|       {
#  560|         if (!any)
#  561|->         tty_fprintf (fp, "[Supported by: ");
#  562|         tty_fprintf (fp, "%s%s", any?", ":"", app_type_string (value));
#  563|         any = 1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def232]
gnupg-2.4.9/tools/gpg-card.c:562:7: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tools/gpg-card.c:2467:1: enter_function: entry to ‘cmd_forcesig’
gnupg-2.4.9/tools/gpg-card.c:2473:12: call_function: calling ‘print_help’ from ‘cmd_forcesig’
#  560|         if (!any)
#  561|           tty_fprintf (fp, "[Supported by: ");
#  562|->       tty_fprintf (fp, "%s%s", any?", ":"", app_type_string (value));
#  563|         any = 1;
#  564|       }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def233]
gnupg-2.4.9/tools/gpg-card.c:566:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tools/gpg-card.c:2467:1: enter_function: entry to ‘cmd_forcesig’
gnupg-2.4.9/tools/gpg-card.c:2473:12: call_function: calling ‘print_help’ from ‘cmd_forcesig’
#  564|       }
#  565|     if (any)
#  566|->     tty_fprintf (fp, "]\n");
#  567|   
#  568|     va_end (arg_ptr);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def234]
gnupg-2.4.9/tools/gpg-pair-tool.c:537:7: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tools/gpg-pair-tool.c:536:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/tools/gpg-pair-tool.c:537:7: throw: if ‘gpgrt_vasprintf’ throws an exception...
gnupg-2.4.9/tools/gpg-pair-tool.c:537:7: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  535|   
#  536|     va_start (arg_ptr, format);
#  537|->   if (gpgrt_vasprintf (&buffer, format, arg_ptr) < 0)
#  538|       log_fatal ("estream_asprintf failed: %s\n",
#  539|                  gpg_strerror (gpg_error_from_syserror ()));

Error: GCC_ANALYZER_WARNING (CWE-404): [#def235]
gnupg-2.4.9/tools/gpg-pair-tool.c:1083:7: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tools/gpg-pair-tool.c:1071:3: branch_false: following ‘false’ branch (when ‘resultsize > 31’)...
gnupg-2.4.9/tools/gpg-pair-tool.c:1073:9: branch_false: ...to here
gnupg-2.4.9/tools/gpg-pair-tool.c:1074:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpg-pair-tool.c:1078:3: branch_false: ...to here
gnupg-2.4.9/tools/gpg-pair-tool.c:1078:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/tools/gpg-pair-tool.c:1079:10: branch_true: following ‘true’ branch (when ‘data’ is non-NULL)...
gnupg-2.4.9/tools/gpg-pair-tool.c:1081:7: branch_true: ...to here
gnupg-2.4.9/tools/gpg-pair-tool.c:1083:7: throw: if ‘gcry_md_write’ throws an exception...
gnupg-2.4.9/tools/gpg-pair-tool.c:1083:7: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 1081|         datalen = va_arg (arg_ptr, size_t);
# 1082|         /* log_printhex (data, datalen, "    data:"); */
# 1083|->       gcry_md_write (hd, data, datalen);
# 1084|       }
# 1085|     va_end (arg_ptr);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def236]
gnupg-2.4.9/tools/gpg-pair-tool.c:1127:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tools/gpg-pair-tool.c:1112:3: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpg-pair-tool.c:1114:9: branch_false: ...to here
gnupg-2.4.9/tools/gpg-pair-tool.c:1115:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpg-pair-tool.c:1117:9: branch_false: ...to here
gnupg-2.4.9/tools/gpg-pair-tool.c:1118:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpg-pair-tool.c:1122:3: branch_false: ...to here
gnupg-2.4.9/tools/gpg-pair-tool.c:1122:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/tools/gpg-pair-tool.c:1123:10: branch_true: following ‘true’ branch (when ‘data’ is non-NULL)...
gnupg-2.4.9/tools/gpg-pair-tool.c:1125:7: branch_true: ...to here
gnupg-2.4.9/tools/gpg-pair-tool.c:1127:13: throw: if ‘gcry_mac_write’ throws an exception...
gnupg-2.4.9/tools/gpg-pair-tool.c:1127:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 1125|         datalen = va_arg (arg_ptr, size_t);
# 1126|         /* log_printhex (data, datalen, "    data:"); */
# 1127|->       err = gcry_mac_write (hd, data, datalen);
# 1128|         if (err)
# 1129|           log_fatal ("error writing to the MAC handle: %s\n", gpg_strerror (err));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def237]
gnupg-2.4.9/tools/gpgconf-comp.c:2924:13: warning[-Wanalyzer-null-argument]: use of NULL ‘src_filename’ where non-null expected
gnupg-2.4.9/tools/gpgconf-comp.c:2742:9: release_memory: ‘src_filename’ is NULL
gnupg-2.4.9/tools/gpgconf-comp.c:2743:9: release_memory: ‘src_filename’ is NULL
gnupg-2.4.9/tools/gpgconf-comp.c:2744:9: release_memory: ‘src_filename’ is NULL
gnupg-2.4.9/tools/gpgconf-comp.c:2746:9: release_memory: ‘src_filename’ is NULL
gnupg-2.4.9/tools/gpgconf-comp.c:2750:6: branch_false: following ‘false’ branch (when ‘component != 8’)...
gnupg-2.4.9/tools/gpgconf-comp.c:2753:6: branch_false: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2753:6: branch_false: following ‘false’ branch (when ‘in’ is NULL)...
gnupg-2.4.9/tools/gpgconf-comp.c:2825:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2826:10: branch_true: following ‘true’ branch (when ‘option’ is non-NULL)...
gnupg-2.4.9/tools/gpgconf-comp.c:2826:20: branch_true: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2826:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgconf-comp.c:2868:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2870:6: branch_true: following ‘true’ branch (when ‘err == 0’)...
gnupg-2.4.9/tools/gpgconf-comp.c:2870:16: branch_true: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2903:7: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgconf-comp.c:2905:25: branch_true: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2908:11: release_memory: ‘src_filename’ is NULL
gnupg-2.4.9/tools/gpgconf-comp.c:2908:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgconf-comp.c:2921:15: branch_false: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2921:15: release_memory: ‘src_filename’ is NULL
gnupg-2.4.9/tools/gpgconf-comp.c:2921:14: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgconf-comp.c:2924:13: branch_false: ...to here
gnupg-2.4.9/tools/gpgconf-comp.c:2924:13: release_memory: ‘src_filename’ is NULL
gnupg-2.4.9/tools/gpgconf-comp.c:2924:13: danger: argument 1 (‘dest_filename’) NULL where non-null expected
# 2922|               gnupg_rename_file (orig_filename, dest_filename, NULL);
# 2923|             else
# 2924|->             unlink (dest_filename);
# 2925|           }
# 2926|         if (err)

Error: COMPILER_WARNING (CWE-704): [#def238]
gnupg-2.4.9/tools/gpgconf.c: scope_hint: In function ‘query_swdb’
gnupg-2.4.9/tools/gpgconf.c:555:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  555 |       p = strrchr (fields[0], '_');
#      |         ^
#  553|   
#  554|         /* Tokenize the name.  */
#  555|->       p = strrchr (fields[0], '_');
#  556|         if (!p)
#  557|           continue; /* Name w/o an underscore.  */

Error: COMPILER_WARNING (CWE-704): [#def239]
gnupg-2.4.9/tools/gpgconf.c:555:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  553|   
#  554|         /* Tokenize the name.  */
#  555|->       p = strrchr (fields[0], '_');
#  556|         if (!p)
#  557|           continue; /* Name w/o an underscore.  */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def240]
gnupg-2.4.9/tools/gpgparsemail.c:108:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_resource: opened here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  106|     va_list arg_ptr;
#  107|   
#  108|->   fflush (stdout);
#  109|     fprintf (stderr, "%s: ", PGM);
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def241]
gnupg-2.4.9/tools/gpgparsemail.c:108:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_memory: allocated here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  106|     va_list arg_ptr;
#  107|   
#  108|->   fflush (stdout);
#  109|     fprintf (stderr, "%s: ", PGM);
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def242]
gnupg-2.4.9/tools/gpgparsemail.c:630:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_resource: opened here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  628|     memset (&info, 0, sizeof info);
#  629|   
#  630|->   msg = rfc822parse_open (message_cb, &info);
#  631|     if (!msg)
#  632|       die ("can't open parser: %s", strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def243]
gnupg-2.4.9/tools/gpgparsemail.c:630:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_memory: allocated here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  628|     memset (&info, 0, sizeof info);
#  629|   
#  630|->   msg = rfc822parse_open (message_cb, &info);
#  631|     if (!msg)
#  632|       die ("can't open parser: %s", strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def244]
gnupg-2.4.9/tools/gpgparsemail.c:632:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_resource: opened here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  630|     msg = rfc822parse_open (message_cb, &info);
#  631|     if (!msg)
#  632|->     die ("can't open parser: %s", strerror (errno));
#  633|   
#  634|     /* Fixme: We should not use fgets because it can't cope with

Error: GCC_ANALYZER_WARNING (CWE-401): [#def245]
gnupg-2.4.9/tools/gpgparsemail.c:632:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_memory: allocated here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  630|     msg = rfc822parse_open (message_cb, &info);
#  631|     if (!msg)
#  632|->     die ("can't open parser: %s", strerror (errno));
#  633|   
#  634|     /* Fixme: We should not use fgets because it can't cope with

Error: GCC_ANALYZER_WARNING (CWE-775): [#def246]
gnupg-2.4.9/tools/gpgparsemail.c:643:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_resource: opened here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  641|   
#  642|         length = strlen (line);
#  643|->       if (length && line[length - 1] == '\n')
#  644|   	line[--length] = 0;
#  645|         else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
gnupg-2.4.9/tools/gpgparsemail.c:643:26: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*argv, "rb")’
gnupg-2.4.9/tools/gpgparsemail.c:738:1: enter_function: entry to ‘main’
gnupg-2.4.9/tools/gpgparsemail.c:792:6: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
gnupg-2.4.9/tools/gpgparsemail.c:795:3: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:797:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:799:18: acquire_memory: allocated here
gnupg-2.4.9/tools/gpgparsemail.c:800:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/gpgparsemail.c:802:7: branch_false: ...to here
gnupg-2.4.9/tools/gpgparsemail.c:802:7: call_function: calling ‘parse_message’ from ‘main’
#  641|   
#  642|         length = strlen (line);
#  643|->       if (length && line[length - 1] == '\n')
#  644|   	line[--length] = 0;
#  645|         else

Error: CPPCHECK_WARNING (CWE-476): [#def248]
gnupg-2.4.9/tools/rfc822parse.c:693: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#  691|     if (valueoff)
#  692|       {
#  693|->       p = strchr (buf, ':');
#  694|         if (!p)
#  695|           *valueoff = 0; /* Oops: should never happen. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def249]
gnupg-2.4.9/tools/watchgnupg.c:72:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[0]’
gnupg-2.4.9/tools/watchgnupg.c:282:1: enter_function: entry to ‘get_logname’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_true: following ‘true’ branch (when ‘pid == -1’)...
gnupg-2.4.9/tools/watchgnupg.c:296:49: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:296:5: call_function: calling ‘die’ from ‘get_logname’
#   70|     va_list arg_ptr;
#   71|   
#   72|->   fflush (stdout);
#   73|     fprintf (stderr, "%s: ", PGM);
#   74|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def250]
gnupg-2.4.9/tools/watchgnupg.c:72:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[1]’
gnupg-2.4.9/tools/watchgnupg.c:282:1: enter_function: entry to ‘get_logname’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_true: following ‘true’ branch (when ‘pid == -1’)...
gnupg-2.4.9/tools/watchgnupg.c:296:49: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:296:5: call_function: calling ‘die’ from ‘get_logname’
#   70|     va_list arg_ptr;
#   71|   
#   72|->   fflush (stdout);
#   73|     fprintf (stderr, "%s: ", PGM);
#   74|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
gnupg-2.4.9/tools/watchgnupg.c:72:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
gnupg-2.4.9/tools/watchgnupg.c:282:1: enter_function: entry to ‘get_logname’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
gnupg-2.4.9/tools/watchgnupg.c:328:3: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:330:8: acquire_memory: allocated here
gnupg-2.4.9/tools/watchgnupg.c:331:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
gnupg-2.4.9/tools/watchgnupg.c:331:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:335:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/watchgnupg.c:337:11: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:337:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:339:7: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:340:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:340:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:335:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/watchgnupg.c:337:11: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:340:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:340:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:335:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/watchgnupg.c:337:11: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:338:9: call_function: calling ‘die’ from ‘get_logname’
#   70|     va_list arg_ptr;
#   71|   
#   72|->   fflush (stdout);
#   73|     fprintf (stderr, "%s: ", PGM);
#   74|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def252]
gnupg-2.4.9/tools/watchgnupg.c:302:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[0]’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:302:12: throw: if ‘open’ throws an exception...
gnupg-2.4.9/tools/watchgnupg.c:302:12: danger: ‘rp[0]’ leaks here
#  300|         int fd;
#  301|   
#  302|->       fd = open ("/dev/null", O_WRONLY);
#  303|         if (fd == -1)
#  304|           die ("can't open '/dev/null': %s", strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def253]
gnupg-2.4.9/tools/watchgnupg.c:302:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[1]’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:302:12: throw: if ‘open’ throws an exception...
gnupg-2.4.9/tools/watchgnupg.c:302:12: danger: ‘rp[1]’ leaks here
#  300|         int fd;
#  301|   
#  302|->       fd = open ("/dev/null", O_WRONLY);
#  303|         if (fd == -1)
#  304|           die ("can't open '/dev/null': %s", strerror (errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def254]
gnupg-2.4.9/tools/watchgnupg.c:305:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:302:12: acquire_resource: opened here
gnupg-2.4.9/tools/watchgnupg.c:303:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:305:10: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(8)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/7)
#  303|         if (fd == -1)
#  304|           die ("can't open '/dev/null': %s", strerror (errno));
#  305|->       if (fd != 0 && dup2 (fd, 0) == -1)
#  306|           die ("dup2 stderr failed: %s", strerror (errno));
#  307|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def255]
gnupg-2.4.9/tools/watchgnupg.c:305:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 1), 0)’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:303:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:22: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:305:22: acquire_resource: opened here
gnupg-2.4.9/tools/watchgnupg.c:305:11: danger: ‘dup2(open("/dev/null", 1), 0)’ leaks here; was opened at [(12)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/11)
#  303|         if (fd == -1)
#  304|           die ("can't open '/dev/null': %s", strerror (errno));
#  305|->       if (fd != 0 && dup2 (fd, 0) == -1)
#  306|           die ("dup2 stderr failed: %s", strerror (errno));
#  307|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def256]
gnupg-2.4.9/tools/watchgnupg.c:305:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:302:12: acquire_resource: opened here
gnupg-2.4.9/tools/watchgnupg.c:303:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:22: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:305:22: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(8)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/7)
#  303|         if (fd == -1)
#  304|           die ("can't open '/dev/null': %s", strerror (errno));
#  305|->       if (fd != 0 && dup2 (fd, 0) == -1)
#  306|           die ("dup2 stderr failed: %s", strerror (errno));
#  307|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def257]
gnupg-2.4.9/tools/watchgnupg.c:309:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(rp[1], 1)’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:303:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:309:10: branch_true: following ‘true’ branch...
gnupg-2.4.9/tools/watchgnupg.c:309:25: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:309:25: acquire_resource: opened here
gnupg-2.4.9/tools/watchgnupg.c:309:11: danger: ‘dup2(rp[1], 1)’ leaks here; was opened at [(12)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/11)
#  307|   
#  308|         /* Connect stdout to our pipe. */
#  309|->       if (rp[1] != 1 && dup2 (rp[1], 1) == -1)
#  310|           die ("dup2 stdout failed: %s", strerror (errno));
#  311|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def258]
gnupg-2.4.9/tools/watchgnupg.c:315:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[0]’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:303:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:314:17: branch_true: following ‘true’ branch (when ‘i != 20’)...
gnupg-2.4.9/tools/watchgnupg.c:315:9: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:315:9: throw: if ‘close’ throws an exception...
gnupg-2.4.9/tools/watchgnupg.c:315:9: danger: ‘rp[0]’ leaks here
#  313|          * we have not opened many files. */
#  314|         for (i=3; i < 20; i++)
#  315|->         close (i);
#  316|         errno = 0;
#  317|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def259]
gnupg-2.4.9/tools/watchgnupg.c:315:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[1]’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
gnupg-2.4.9/tools/watchgnupg.c:302:12: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:303:10: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:305:10: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:314:17: branch_true: following ‘true’ branch (when ‘i != 20’)...
gnupg-2.4.9/tools/watchgnupg.c:315:9: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:315:9: throw: if ‘close’ throws an exception...
gnupg-2.4.9/tools/watchgnupg.c:315:9: danger: ‘rp[1]’ leaks here
#  313|          * we have not opened many files. */
#  314|         for (i=3; i < 20; i++)
#  315|->         close (i);
#  316|         errno = 0;
#  317|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def260]
gnupg-2.4.9/tools/watchgnupg.c:328:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[0]’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
gnupg-2.4.9/tools/watchgnupg.c:328:3: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:328:3: throw: if ‘close’ throws an exception...
gnupg-2.4.9/tools/watchgnupg.c:328:3: danger: ‘rp[0]’ leaks here
#  326|   
#  327|     /* Parent. */
#  328|->   close (rp[1]);
#  329|   
#  330|     fp = fdopen (rp[0], "r");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def261]
gnupg-2.4.9/tools/watchgnupg.c:328:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rp[1]’
gnupg-2.4.9/tools/watchgnupg.c:291:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tools/watchgnupg.c:294:9: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:295:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:298:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
gnupg-2.4.9/tools/watchgnupg.c:328:3: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:328:3: throw: if ‘close’ throws an exception...
gnupg-2.4.9/tools/watchgnupg.c:328:3: danger: ‘rp[1]’ leaks here
#  326|   
#  327|     /* Parent. */
#  328|->   close (rp[1]);
#  329|   
#  330|     fp = fdopen (rp[0], "r");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def262]
gnupg-2.4.9/tools/watchgnupg.c:533:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_un’
gnupg-2.4.9/tools/watchgnupg.c:489:6: branch_true: following ‘true’ branch (when ‘argc != 0’)...
gnupg-2.4.9/tools/watchgnupg.c:490:5: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:509:6: branch_true: following ‘true’ branch (when ‘logname’ is non-NULL)...
gnupg-2.4.9/tools/watchgnupg.c:511:19: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:511:19: acquire_resource: stream socket created here
gnupg-2.4.9/tools/watchgnupg.c:512:10: branch_false: following ‘false’ branch (when ‘server_un != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:514:11: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:523:6: branch_false: following ‘false’ branch (when ‘server_in == -1’)...
gnupg-2.4.9/tools/watchgnupg.c:531:6: branch_false: ...to here
gnupg-2.4.9/tools/watchgnupg.c:531:6: branch_true: following ‘true’ branch (when ‘server_un != -1’)...
gnupg-2.4.9/tools/watchgnupg.c:533:15: branch_true: ...to here
gnupg-2.4.9/tools/watchgnupg.c:533:15: throw: if ‘fcntl’ throws an exception...
gnupg-2.4.9/tools/watchgnupg.c:533:15: danger: ‘server_un’ leaks here
#  531|     if (server_un != -1)
#  532|       {
#  533|->       flags = fcntl (server_un, F_GETFL, 0);
#  534|         if (flags == -1)
#  535|           die ("fcntl (F_GETFL) failed: %s\n", strerror (errno));

Error: CPPCHECK_WARNING (CWE-476): [#def263]
gnupg-2.4.9/tools/watchgnupg.c:557: error[nullPointer]: Null pointer dereference: (struct sockaddr_un*)0
#  555|         srvr_addr_un.sun_path[sizeof (srvr_addr_un.sun_path) - 1] = 0;
#  556|         addr_un = (struct sockaddr *)&srvr_addr_un;
#  557|->       addrlen_un = SUN_LEN (&srvr_addr_un);
#  558|       }
#  559|     else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def264]
gnupg-2.4.9/tpm2d/intel-tss.h:360:8: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tpm2d/intel-tss.h:341:1: enter_function: entry to ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:350:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/tpm2d/intel-tss.h:352:8: call_function: inlined call to ‘TSS_Hash_GetMd’ from ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:360:8: throw: if ‘gcry_md_open’ throws an exception...
gnupg-2.4.9/tpm2d/intel-tss.h:360:8: danger: missing call to ‘va_end’ to match ‘va_start’ at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  358|       }
#  359|   
#  360|->   rc = gcry_md_open (&md, algo, 0);
#  361|     if (rc != 0)
#  362|       {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def265]
gnupg-2.4.9/tpm2d/intel-tss.h:381:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tpm2d/intel-tss.h:341:1: enter_function: entry to ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:350:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/tpm2d/intel-tss.h:352:8: call_function: inlined call to ‘TSS_Hash_GetMd’ from ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:361:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tpm2d/intel-tss.h:361:6: branch_false: ...to here
gnupg-2.4.9/tpm2d/intel-tss.h:373:10: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
gnupg-2.4.9/tpm2d/intel-tss.h:375:10: branch_false: ...to here
gnupg-2.4.9/tpm2d/intel-tss.h:375:10: branch_false: following ‘false’ branch (when ‘length >= 0’)...
gnupg-2.4.9/tpm2d/intel-tss.h:380:10: branch_false: ...to here
gnupg-2.4.9/tpm2d/intel-tss.h:380:10: branch_true: following ‘true’ branch (when ‘length != 0’)...
gnupg-2.4.9/tpm2d/intel-tss.h:381:9: branch_true: ...to here
gnupg-2.4.9/tpm2d/intel-tss.h:381:9: throw: if ‘gcry_md_write’ throws an exception...
gnupg-2.4.9/tpm2d/intel-tss.h:381:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  379|   	}
#  380|         if (length != 0)
#  381|-> 	gcry_md_write (md, buffer, length);
#  382|       }
#  383|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def266]
gnupg-2.4.9/tpm2d/intel-tss.h:384:28: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tpm2d/intel-tss.h:341:1: enter_function: entry to ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:350:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/tpm2d/intel-tss.h:352:8: call_function: inlined call to ‘TSS_Hash_GetMd’ from ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:361:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tpm2d/intel-tss.h:361:6: branch_false: ...to here
gnupg-2.4.9/tpm2d/intel-tss.h:385:11: call_function: inlined call to ‘TSS_GetDigestSize’ from ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:384:28: throw: if ‘gcry_md_read’ throws an exception...
gnupg-2.4.9/tpm2d/intel-tss.h:384:28: danger: missing call to ‘va_end’ to match ‘va_start’ at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
#  382|       }
#  383|   
#  384|->   memcpy (&digest->digest, gcry_md_read (md, algo),
#  385|   	  TSS_GetDigestSize(digest->hashAlg));
#  386|     rc = TPM_RC_SUCCESS;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def267]
gnupg-2.4.9/tpm2d/intel-tss.h:388:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
gnupg-2.4.9/tpm2d/intel-tss.h:341:1: enter_function: entry to ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:350:3: acquire_resource: ‘va_start’ called here
gnupg-2.4.9/tpm2d/intel-tss.h:352:8: call_function: inlined call to ‘TSS_Hash_GetMd’ from ‘TSS_Hash_Generate’
gnupg-2.4.9/tpm2d/intel-tss.h:361:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tpm2d/intel-tss.h:361:6: branch_false: ...to here
gnupg-2.4.9/tpm2d/intel-tss.h:373:10: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
gnupg-2.4.9/tpm2d/intel-tss.h:375:10: branch_false: ...to here
gnupg-2.4.9/tpm2d/intel-tss.h:388:3: throw: if ‘gcry_md_close’ throws an exception...
gnupg-2.4.9/tpm2d/intel-tss.h:388:3: danger: missing call to ‘va_end’ to match ‘va_start’ at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
#  386|     rc = TPM_RC_SUCCESS;
#  387|    out_free:
#  388|->   gcry_md_close (md);
#  389|    out:
#  390|     va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def268]
gnupg-2.4.9/tpm2d/tpm2daemon.c:957:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘assuan_sock_new(1, 1, 0)’
gnupg-2.4.9/tpm2d/tpm2daemon.c:936:6: branch_false: following ‘false’ branch...
gnupg-2.4.9/tpm2d/tpm2daemon.c:942:12: branch_false: ...to here
gnupg-2.4.9/tpm2d/tpm2daemon.c:948:8: branch_false: following ‘false’ branch...
gnupg-2.4.9/tpm2d/tpm2daemon.c:957:9: branch_false: ...to here
gnupg-2.4.9/tpm2d/tpm2daemon.c:989:6: branch_true: following ‘true’ branch...
gnupg-2.4.9/tpm2d/tpm2daemon.c:991:7: branch_true: ...to here
gnupg-2.4.9/tpm2d/tpm2daemon.c:957:9: danger: ‘assuan_sock_new(1, 1, 0)’ leaks here
#  955|           tpm2d_exit (2);
#  956|         }
#  957|->     if (redirected)
#  958|         {
#  959|           *r_redir_name = xstrdup (unaddr->sun_path);

Error: COMPILER_WARNING (CWE-252): [#def269]
gnupg-2.4.9/tpm2d/tpm2daemon.c: scope_hint: In function ‘tpm2d_kick_the_loop’
gnupg-2.4.9/tpm2d/tpm2daemon.c:1062:3: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
# 1062 |   write (notify_fd, "", 1);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~
# 1060|                  w32_strerror (-1));
# 1061|   #elif defined(HAVE_PSELECT_NO_EINTR)
# 1062|->   write (notify_fd, "", 1);
# 1063|   #else
# 1064|     int ret;

Error: COMPILER_WARNING (CWE-252): [#def270]
gnupg-2.4.9/tpm2d/tpm2daemon.c: scope_hint: In function ‘handle_connections’
gnupg-2.4.9/tpm2d/tpm2daemon.c:1230:11: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
# 1230 |           read (pipe_fd[0], buf, sizeof buf);
#      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1228|             char buf[256];
# 1229|   
# 1230|->           read (pipe_fd[0], buf, sizeof buf);
# 1231|           }
# 1232|   #endif

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-173.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namegnupg2-2.4.9-1.fc44
store-results-to/tmp/tmpz2ef4zw9/gnupg2-2.4.9-1.fc44.tar.xz
time-created2026-01-08 16:45:44
time-finished2026-01-08 16:49:56
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpz2ef4zw9/gnupg2-2.4.9-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpz2ef4zw9/gnupg2-2.4.9-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9